Select Range to Last used Row

G

GregR

How do I select a range of cells to the last used row in a column if there
are blank rows in the column. TIA

Greg
 
B

Bob Phillips

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

GregR

Bob, I believe what you gave me would find the last filled row in column A.
How do I use that to select a range from say K6 to last filled row. Would it
be Range(Cells(11,6),Cells(cLastRow)).select. TIA

Greg

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

Not quite, you have to specify the column in each part

Range(Cells(11,6),Cells(11,cLastRow))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

More easily, you can also use

Range("K6:K" & cLastRow)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

oops, just realised the rows and columns are mixed in the first solution,
which should be

Range(Cells(11,6),Cells(cLastRow,6))

which equates to

Range("F11:F" & cLastRow)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

GregR

Thank you Bob

Greg
oops, just realised the rows and columns are mixed in the first solution,
which should be

Range(Cells(11,6),Cells(cLastRow,6))

which equates to

Range("F11:F" & cLastRow)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Top