Select Range to Last used Row

  • Thread starter Thread starter GregR
  • Start date Start date
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
 
cLastRow = Cells(Rows.Count,"A").End(xlUp).Row

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
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)
 
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)
 
More easily, you can also use

Range("K6:K" & cLastRow)

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
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)
 
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)
 

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