VBA Range Syntax Range(A2:???????) where ??? is Last used cell Col

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using XL 2003 & 97

What is the correct syntax for Range() as per the Subject Line?

The following works fine:

Set MyRange =
Worksheets("Sheet1").Range("A2:A10000").SpecialCells(xlCellTypeBlanks)

But, I want Range("A2:A10000") to be A2 : to the Last used cell Col A

Any thoughts?

TIA

Dennis
 
How about:

with worksheets("sheet1")
set myrange = .range("a2",.cells(.rows.count,"A").end(xlup))
end with

You can add the .specialcells() stuff in that line or later.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top