I have the following code
Dim Shop1 As String
With Worksheets("Data Page")
Shop1 = Application.WorksheetFunction.Index(.Range("B2:B7"), Application.Worksheet.Match(profitable1, .Range("E2:E7"), 0))
End With
This is how my excel looks like
The code works at first, but after I change some value,it suddenly does not and the above error pops out. Can someone tell me why? Thank you so much for helping
