Dim LR As Long
Dim r As Long
On Error Resume Next
r = Cells(1, 1).UsedRange.Resize(1).Find(what:="Total", lookat:=xlWhole).Column
On Error GoTo 0
If r Then LR = Cells(Rows.Count, r).End(xlUp).Row
Try:
Rich (BB code):Dim LR As Long Dim r As Long On Error Resume Next r = Cells(1, 1).UsedRange.Resize(1).Find(what:="Total", lookat:=xlWhole).Column On Error GoTo 0 If r Then LR = Cells(Rows.Count, r).End(xlUp).Row
r = Cells(1, 1).EntireRow.Find(what:="Total", lookat:=xlWhole).Column
Change line in red to:and try (tested and r = 17 if I put "Total" into Q1)Code:r = Cells(1, 1).EntireRow.Find(what:="Total", lookat:=xlWhole).Column