I\'m writing a method in VBA in Excel 2013 to loop through the rows in two worksheets and compare the text in a column from each. When I run my code, I find that the code lo
You can try this:
Dim xlastcel As Range
On Error Resume Next
ActiveSheet.ShowAllData: Err.Clear ' Show All
ActiveSheet.UsedRange ' Ajust Vertical Scrool
With ActiveSheet: Set xlastcell = .Cells.Find(What:="*", After:=.[A1], SearchDirection:=xlPrevious): End With
If Err.Number > 0 Then MsgBox "Sheet without data", vbOKOnly
On Error GoTo 0