ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Basic Input Forms (https://www.excelbanter.com/excel-programming/273149-basic-input-forms.html)

DLS[_2_]

Basic Input Forms
 
I'm a newbie to Excel programming and am having a problem with input
forms. I've written the following code for a form to come up when the
worksheet opens and the user must input their name and serial number.
I can't figure out nor find the answer in books as to how to save the
info, name and serial, in a spreadsheet cell for later use. The
following is as far as I've gotten and would appreciate any and all
help.
Thanks
DLS

Sub Auto_Open()
Call Macro1
End Sub
Sub Macro1()
' Macro1 Macro
' Macro recorded 7/30/2003 by DLS
'Sub Auto_Open()
MsgBox "Hello"
Call Macro2 'This calls for Macro2 to run
End Sub
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/30/2003 by DLS
'Sub GetInput()
Dim MyInput
MyInput = InputBox("Enter your Name") + InputBox("Enter Serial
Number")
MsgBox ("Hello ") & MyInput
A1 = MyInput
End Sub

Tom Ogilvy

Basic Input Forms
 
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/30/2003 by DLS
Dim MyInput as String
MyInput = InputBox("Enter your Name") & " " & InputBox("Enter Serial
Number")
MsgBox ("Hello ") & MyInput
Range("A1").Value = MyInput
End Sub

Regards,
Tom Ogilvy

DLS wrote in message
om...
I'm a newbie to Excel programming and am having a problem with input
forms. I've written the following code for a form to come up when the
worksheet opens and the user must input their name and serial number.
I can't figure out nor find the answer in books as to how to save the
info, name and serial, in a spreadsheet cell for later use. The
following is as far as I've gotten and would appreciate any and all
help.
Thanks
DLS

Sub Auto_Open()
Call Macro1
End Sub
Sub Macro1()
' Macro1 Macro
' Macro recorded 7/30/2003 by DLS
'Sub Auto_Open()
MsgBox "Hello"
Call Macro2 'This calls for Macro2 to run
End Sub
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 7/30/2003 by DLS
'Sub GetInput()
Dim MyInput
MyInput = InputBox("Enter your Name") + InputBox("Enter Serial
Number")
MsgBox ("Hello ") & MyInput
A1 = MyInput
End Sub





All times are GMT +1. The time now is 11:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com