Find Usedrange question

S

Stuart

How best to find the usedrange for just
columns H to J, please? By that I mean
say H4:J500, where row 4 is the location
of the first data in any of cols H to J, and
row 500 is the last row in H, I or J with
any data. The data is a single capital or
lower case letter.

Regards.
 
T

Tom Ogilvy

Dim LastRow as Long
With Worksheets("sheet1")
LastRow = _
application.max(.range("H501").end(xlup).row, _
.range("I501").End(xlup).row, _
.range("J501").end(xlup).row)
End With
if LastRow < 4 then
msgbox "Bad Data"
End if
 
S

Stuart

Many thanks.

Regards.

Tom Ogilvy said:
Dim LastRow as Long
With Worksheets("sheet1")
LastRow = _
application.max(.range("H501").end(xlup).row, _
.range("I501").End(xlup).row, _
.range("J501").end(xlup).row)
End With
if LastRow < 4 then
msgbox "Bad Data"
End if
 

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

Top