Find Usedrange question

  • Thread starter Thread starter Stuart
  • Start date Start date
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.
 
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
 
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
 
Back
Top