Dummy Excel
Well-known Member
- Joined
- Sep 21, 2005
- Messages
- 1,004
- Office Version
-
- 2019
- 2010
- 2007
- Platform
-
- Windows
Hi All,
I have an inputbox
The problem I have is that some users may seperate the 2 words for the customer name, as later down the code I have a IF statement saying if the customer is A do this, if the B do this and so on.
My problem is, if the user seperates the customer, the IF statement wont find a match.
my code for the IF statement is:
What can I do so that if the user seperates the 2 words it will put them together?
thanks
Sam
I have an inputbox
Code:
customer = UCase(InputBox("Enter Customer Name", "Customer", "XXX X"))
The problem I have is that some users may seperate the 2 words for the customer name, as later down the code I have a IF statement saying if the customer is A do this, if the B do this and so on.
My problem is, if the user seperates the customer, the IF statement wont find a match.
my code for the IF statement is:
Code:
If customer = "XXXXX" Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="\\share\XXXXX\" & business & " - " & dept & ".xls"
Application.DisplayAlerts = True
Else
If customer = "XXXXXX" Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename"\\share\XXXXXX\" & business & " - " & dept & ".xls"
Application.DisplayAlerts = True
Else
If customer = "XXX XXXX" Then
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:=""\\share\XXX XXXX\" & business & " - " & dept & ".xls"
Application.DisplayAlerts = True
End If
End If
End If
What can I do so that if the user seperates the 2 words it will put them together?
thanks
Sam