Link to home
Start Free TrialLog in
Avatar of Not2ruthless
Not2ruthless

asked on

How to Check String in top row of active column

I am a new to VBA (fun!) and am trying to write code that determines if the top cell (on row 5) of  the active column  contains a specific string.  e.g. "Sun".  I understand how to use the intstr, but cannot figure out how to change the range/cell reference in the bracket to reflect a different column.  Thanks for any advice at all!!!

 If InStr(1, [b5], "Sun", vbTextCompare) > 0 Then
MsgBox "It is Sunday."
Else
MsgBox "It is not Sunday"
End If
Avatar of jimyX
jimyX

I do not use VBA but I know you can use COLUMN() to retrieve the current column.
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Not2ruthless

ASKER

Thank you!