Selecting Data Ranges

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

I have an application that collects and formats data for
input into another system. The data is input by the user
in continuous rows but may not have continuous columns.

I've tried using the following:

MyCellAddress = ActiveCell.Address
If MyCellAddress = "$A$3" Then Range(Range("A3"),
ActiveCell.SpecialCells(xlCellTypeLastCell)).Select
Else Range(Range("A4"), ActiveCell.SpecialCells
(xlCellTypeLastCell)).Select
End If

Any ideas why on some sheets it goes past the end of the
last row or last column? I have checked for entries,
cleared and deleted the empty rows/columns but doesn't
seem to make any difference.

Any better solutions to select a range that has blank
columns in the data range?

Thanks for any help.
 
Hi Lee,

another possibility is

Range(Range("a4"), Range("a" & rows.Count).End
xlUp)).Select

Best regards

Wolf
 

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