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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Iridium

Well-known Member
Joined
Jul 15, 2002
Messages
2,831
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

ben1987

New Member
Joined
Feb 3, 2004
Messages
18
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

Iridium

Well-known Member
Joined
Jul 15, 2002
Messages
2,831
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

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
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

Iridium

Well-known Member
Joined
Jul 15, 2002
Messages
2,831
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,187,187
Messages
5,962,101
Members
438,583
Latest member
DJTCharts

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
Top