Ste_Moore01
Active Member
- Joined
- Jul 13, 2005
- Messages
- 467
Hi,
I've got some code to make an input box
This input box will only let you proceed if you enter some data.
Is there a way of making it so that if you press the Escape key it cancels the input box and goes to the worksheet named "DETAILS ENTRY"?
So, if you press cancel or ok with no data in the box it says "You did not enter a company name! Please try again!" and goes back to the input box, but if you press Escape it get's rid of the input box and goes to the "DETAILS ENTRY" worksheet?
Any help would be appreciated.
Thanks!
I've got some code to make an input box
Code:
Dim go_on1 As Boolean, mycount1 As String
go_on1 = False
Do While go_on1 = False
Dim Company_Name As String
Company_Name = InputBox("Please type in the Company Name")
If Company_Name = "" Then
Call Beeper1
Beep
MsgBox "You did not enter a company name! Please try again!"
Else: go_on1 = True
Sheets("DETAILS ENTRY").[c1] = Company_Name
End If
Loop
This input box will only let you proceed if you enter some data.
Is there a way of making it so that if you press the Escape key it cancels the input box and goes to the worksheet named "DETAILS ENTRY"?
So, if you press cancel or ok with no data in the box it says "You did not enter a company name! Please try again!" and goes back to the input box, but if you press Escape it get's rid of the input box and goes to the "DETAILS ENTRY" worksheet?
Any help would be appreciated.
Thanks!