Hey I am trying to make an IF statement as part of a lookup and filter macro for a guest list, and I am trying to get any value within a Named range (Its called ActualGuestSurname)
How do I make the IF statment compare the input to any value in this named range?
Thanks
Here is the macro so far (Line I can't figure out in red, in my own words)
Sub Macro1()
Dim intGuestSurname As String
strGuestSurname = InputBox("Enter Guest Surname")
If strGuestSurname = NamedRange("ActualGuestSurname") Then
Application.Goto Reference:="GuestSurname"
ActiveCell.FormulaR1C1 = strGuestSurname
Range("GuestDatabase").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range("Criteria"), Unique:=False
Else
MsgBox "That Guest is not on record", vbCritical
End If
End Sub
Bookmarks