Input Boxes

danielle88

New Member
Joined
Apr 6, 2008
Messages
4
I'm creating a booking form for a boat company (for uni purposes), and i created an input box to enter in the customer code. What i want to happen is when a customer ID code is entered, like C001 for example, i want it to save on a worksheet. Any ideas?
This is my code so far.


Public Sub DisplayInputBox()

Dim x As String
Dim Message As String

Message = "Please Enter in the Customer ID to save this order"

TitleBarTxt = "Save this order"

DefaultTxt = "Enter The Customer ID"

x = InputBox(Message, TitleBarTxt, DefaultTxt)

End Sub
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Need more info, where on the worksheet do you want to save it? and do you want it to save collectively ie into a list or just replace a previous value in a static position?
 
Upvote 0
Basically i need to save the customers details from it.
So i want to save it on another worksheet in the document.
And i want to save it in a list. So each time the buttons clicked, it saves the customers details.

I'm new to all this, so sorry if i'm not making sense.
 
Upvote 0
OK, After your inputbox code, you would need something like this:

Code:
Sheets("SheetName").Range("A" & sheets("SheetName").Range("A" & Rows.Count).End(xlUp).Row + 1).Formula = x

Change SheetName to the name of the sheet you want to record it on and change the "A" in both range statements to whatever column you want to post to.

Cheers

Dan
 
Upvote 0

Forum statistics

Threads
1,215,917
Messages
6,127,703
Members
449,399
Latest member
VEVE4014

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top