Thread
:
If statement not working
View Single Post
#
5
Posted to microsoft.public.excel.programming
Jay
external usenet poster
Posts: 671
If statement not working
Thanks for all the feedback. It looks like any of these ideas will work well.
Thanks for the help!
"Don Guillett" wrote:
Try this idea. It could even be a worksheet_change event requiring no
action.
Sub selectcasef4()
Select Case UCase(Range("f4"))
Case "DAVE": x = "Dave"
Case "BILL": x = "Bill"
Case Else
MsgBox "No name": Exit Sub
End Select
MsgBox x
End Sub
--
Don Guillett
SalesAid Software
"Jay" wrote in message
...
Two questions about the following code.
1- why is it not working?
2- is there a cleaner way to accomplish this?
Sub Test()
If Range("F4") = "" Then
MsgBox "Enter Person Reporting in Cell F4"
Exit Sub
End If
If Range("F4") = "Jay" Then
mySourceWkbkName2 = "F:\files\ProjTimeTracking.xls"
If Range("F4") = "Dave" Then
mySourceWkbkName2 = "H:\FAC\Dave
Sipes\DavProjTimeTracking.xls"
If Range("F4") < "" Then
MsgBox "Person Reporting name mispelled"
Exit Sub
End If
End If
End If
MsgBox (mySourceWkbkName2)
End Sub
Reply With Quote
Jay
View Public Profile
Find all posts by Jay