title: Define range based on the value of another cell
body: <p>Is it possible to define a range in VBA based on a value given in a cell? </p>
  
  <p>For example, I have a dataset with four columns and a constantly changing number of rows. I have the number of rows in cell <code>F2</code>. Suppose cell <code>F2</code> indicates the number of rows is <code>385</code>, then I be able to  <code>Range("A1:D385").Select</code>, but I want the selection of the last cell to be dependent on cell <code>F2</code>. </p>
  
  <p>So if I change <code>F2</code> to <code>50</code>, that the next time I run the macro, <code>A1:D50</code> will be selected, but since I'm new to VBA I can't figure it out.</p>