gogeta1998
New Member
- Joined
- Mar 21, 2022
- Messages
- 6
- Office Version
- 365
- Platform
- Windows
I'm writing a macro to make it such that if a value is found in column B then do one thing, otherwise do another thing. However it doesn't return the correct value because it doesnt look at the the text the formulae outputs.
so, if I write "Please Add Institution" manually then it returns the correct message box, however if there is a formulae making the cell value "Please Add Institution", then it doesn't print the correct message- instead it prints "It Works".
Please help thanks
VBA Code:
Sub Value_Find()
Dim Cell As Range
Columns("B:B").Select
Set Cell = Selection.Find(What:="Please Add Institution", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Cell Is Nothing Then
MsgBox "It Works"
Else
MsgBox "Please Add Institution"
End If
End Sub
so, if I write "Please Add Institution" manually then it returns the correct message box, however if there is a formulae making the cell value "Please Add Institution", then it doesn't print the correct message- instead it prints "It Works".
Please help thanks