camper12
asked on
vba code
Hi,
what would be the vba code to search for a string in a particular column and return true if a match is present?
Thanks
what would be the vba code to search for a string in a particular column and return true if a match is present?
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It's not clear what ranges you are using. If you want to check if the value of C17 appears more than once in Range("C1:C17") then this should work
If Application.WorksheetFunction.CountIf(Range("C1:C17"), Range("C17")) > 0 Then MsgBox "True"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ElseIf (((Range("A17").Value = "A") Or Range("B17").Value = "C") And (Range("C17").Value = Columns("C1:C16").Select
Set cell = Selection.Find(What:=Range
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)))