andrewb90
Well-known Member
- Joined
- Dec 16, 2009
- Messages
- 1,077
I am trying to run a macro but only want it to execute if the text matches.
here is what I am currently using:
What I would like is to have is if somebody types in 'FG' then a message box appears if 'Tu' or 'Gr' are typed in the same thing would happen, then the appropriate cells would hide/unhide.
here is what I am currently using:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "B2" Then
If Len(Target.Value) >= 2 And Len(Target.Value) <= 2 Then
MsgBox "Please proceed to fill out the order for " & Target.Value & "." & vbNewLine & "Have a nice day."
Rows("4:58").Hidden = False
Else
MsgBox "Type in FG for Forest Grove, or Tu for Tualatin or Gr for Gresham. Nothing Else", vbExclamation
Rows("4:58").Hidden = True
End If
End If
End Sub