I'm looking for a way to search every worksheet and then return the lowest row that contains data in a Message Box. What I have so far is...
Sub lowestRow()
Dim currentLowestRow As Integer
Dim lowestRow As Integer
Dim nullMsgBox As Integer
nullMsgBox = 0
currentLowestRow = 0
lowestRow = 0
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Activate
'This is where i would search every cell
'set currentLowestRow to the lowest row on this sheet
'compare currentLowestRow with lowestRow and if
'currentLowestRow is greater set its value to lowestRow
Next ws
Sheets(1).Activate
nullMsgBox = MsgBox("Your Last Row of Data is " & lowestRow, vbOKOnly)
End Sub
There are some instances where the first row(s) on a given worksheet may not contain data. The workbooks also have anywhere from 7-50 sheets. Your help is greatly appreciated.
Bookmarks