Keep getting an error message when running this macro. Looking for some expertise. Many thanks. I added all the tab names in the Array field. I can do a search but then it crashes with an error message.
Option Explicit
Sub FindMeSheet()
Dim CheckNum$
Dim varSheets As Variant
Dim i As Long
Dim c As Range
CheckNum = InputBox("Enter Search String", "Spooky2 Co-Pilot")
If CheckNum = vbNullString Then Exit Sub
varSheets = Array("Vitamins", "QA", "Testimonials", "Natural", "Essential", "Eating", "Audio", "Tutorials")
For i = LBound(varSheets) To UBound(varSheets)
With Sheets(varSheets(i))
Set c = .UsedRange.Find(What:=CheckNum, LookIn:=xlValues)
If Not c Is Nothing Then
MsgBox c.Address & " On " & Sheets(varSheets(i)).Name
End If
End With
Next
End Sub
Option Explicit
Sub FindMeSheet()
Dim CheckNum$
Dim varSheets As Variant
Dim i As Long
Dim c As Range
CheckNum = InputBox("Enter Search String", "Spooky2 Co-Pilot")
If CheckNum = vbNullString Then Exit Sub
varSheets = Array("Vitamins", "QA", "Testimonials", "Natural", "Essential", "Eating", "Audio", "Tutorials")
For i = LBound(varSheets) To UBound(varSheets)
With Sheets(varSheets(i))
Set c = .UsedRange.Find(What:=CheckNum, LookIn:=xlValues)
If Not c Is Nothing Then
MsgBox c.Address & " On " & Sheets(varSheets(i)).Name
End If
End With
Next
End Sub