Good Morning,
I have the below code
This should basically return the column number of the first instance of Store Number (Location) and the column number of the last instance of Store Number
But I'm getting Error 91 not sure why. Please advise
Thanks
I have the below code
Code:
Sub firstandlast()
Dim FCol As Integer
Dim lCol As Integer
FCol = ActiveSheet.Rows(1).Find(What = "Store Number (Location)", LookAt:=xlWhole, SearchDirection:=xlNext, MatchCase:=False).Column
lCol = ActiveSheet.Rows(1).Find(What = "Store Number", LookAt:=xlWhole, SearchDirection:=xlPrevious, MatchCase:=False).Column
MsgBox FirstCol & " And " & LastCol
End Sub
This should basically return the column number of the first instance of Store Number (Location) and the column number of the last instance of Store Number
But I'm getting Error 91 not sure why. Please advise
Thanks