PDA

View Full Version : [SOLVED] An Ify statment in macro module



Erays
09-28-2005, 01:04 PM
I want the macro to let me know when there is mre than 5 and then when there is less than 5 and let me know when there is 5 Then I can add the other macros to run with the if's



Sub Macro911()
If Len(A3) = 5 Then
MsgBox ("You have entered 5 characters.")
ElseIf Len(A3) > 5 Then
MsgBox ("You have entered More than 5 characters.")
ElseIf Len(A3) < 5 Then
MsgBox ("You have entered 5 characters.")
End If
End Sub

Help would be greatly appreciated!

Jacob Hilderbrand
09-28-2005, 01:13 PM
Try this.



Sub Macro911()
If Len(Range("A3").Text) = 5 Then
MsgBox ("You have entered 5 characters.")
ElseIf Len(Range("A3").Text) > 5 Then
MsgBox ("You have entered More than 5 characters.")
Else
MsgBox ("You have entered " & Len(Range("A3").Text) & " characters.")
End If
End Sub

Erays
09-28-2005, 02:26 PM
Thank you so much>.

Jacob Hilderbrand
09-28-2005, 02:46 PM
You're Welcome :beerchug:

Take Care