title: excel VBA function to select the first row in a column and it will will select all cells below it and make it range
body: <p>I'm trying to write a code, I believe it needs to be a function. I want to select the first row in a column and it will create a range with all the rows below it (until empty cell). I think the problem is the syntax for the 'Range'. </p>
  
  <p>(Ultimately my goal is to be ably to select two cells in two different columns, automatically create 2 ranges and plot them against each other in a scatter plot. but I'm struggling with just the first part)</p>
  
  <p>My code looks something like:</p>
  
  <p>`</p>
  
  <pre><code>Function rng1(x as variant)
  
  Dim ji as string, jf as string
  Dim rng1 as range
  
  ji=x.Address
  jf=x.End(xldown).Address
  
  rng1=Range(ji:jf)
  </code></pre>
  
  <p>'</p>