inputbox

ben1987

New Member
Joined
Feb 3, 2004
Messages
18
:rolleyes: hi
i need to create an input box that asks for name, address, and telephone number, but also when it has been entered in it then gets put into cells A1:A3. how do i do this?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Not one input box but three for this one and it's a rough as hell macro but to get the ball rolling....

Code:
Sub test4()
Dim usersname As String
Dim TheAddress As String
Dim PhoneNo As String

usersname = InputBox("Please enter your name")
TheAddress = InputBox("Please enter your address")
PhoneNo = InputBox("Please enter your telephone number")
Range("$A$1").Value = usersname
Range("$A$2").Value = TheAddress
Range("$A$3").Value = PhoneNo
End Sub

HTH
 
Upvote 0
yeh thanx this is great but how do i make it so that the information is not overlapped each time, or so that it adds them on going down the row instead of over the top. if you know what i mean!
 
Upvote 0
ben1987 said:
:pray: :pray: :rolleyes: :rolleyes: :oops:

:confused: Is that you have your answer or not? Or have you worked it out for yourself? If so post it so that it helps other board members...
 
Upvote 0
Adding a bit to Iridium's original code:
Code:
Sub test4()
    
    Dim usersname As String
    Dim TheAddress As String
    Dim PhoneNo As String
    Dim LastRow As Object
        Set LastRow = Sheets("Sheet1").Range("A65536").End(xlUp)
        
    usersname = InputBox("Please enter your name")
    TheAddress = InputBox("Please enter your address")
    PhoneNo = InputBox("Please enter your telephone number")
    LastRow.Offset(1, 0).Value = usersname
    LastRow.Offset(1, 1).Value = TheAddress
    LastRow.Offset(1, 2).Value = PhoneNo
    
End Sub
Hope that helps,

Smitty
 
Upvote 0
pennysaver said:
Adding a bit to Iridium's original code:
Code:
Sub test4()
    
    Dim usersname As String
    Dim TheAddress As String
    Dim PhoneNo As String
    Dim LastRow As Object
        Set LastRow = Sheets("Sheet1").Range("A65536").End(xlUp)
        
    usersname = InputBox("Please enter your name")
    TheAddress = InputBox("Please enter your address")
    PhoneNo = InputBox("Please enter your telephone number")
    LastRow.Offset(1, 0).Value = usersname
    LastRow.Offset(1, 1).Value = TheAddress
    LastRow.Offset(1, 2).Value = PhoneNo
    
End Sub
Hope that helps,

Smitty

Kewl code Smitty! Never can get to grips with that offsetting!
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,457
Members
448,898
Latest member
drewmorgan128

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