Wendy,
Copy this code to your template (replace references in BOLD w/your own):
Sub Auto_Open()
' Declare variables...
Dim Message, Title, Default, myVal, Data1, Data2, Data3
' Prompt user for 3 pieces of info...
For myInfo = 1 To 3
' This is a repeat point if user doesn't enter data when prompted...
StartOver:
' Define Input dialog parameters...
Message = "Enter data " & myInfo & " value: "
Title = "Data " & myInfo & " Value"
Default = ""
' Prompt user to enter data...
myVal = InputBox(Message, Title, Default)
' Begin again if user cancels Input dialog or doesn't enter any data...
If myVal = "" Then GoTo StartOver
' Otherwise, assign user data to variables...
If myInfo = 1 Then
Data1 = myVal
ElseIf myInfo = 2 Then
Data2 = myVal
Else
Data3 = myVal
End If
Next myInfo
' Populate worksheet with user input...
ActiveWorkbook.Worksheets("Sheet1").Unprotect Password:="your_Password"
ActiveWorkbook.Worksheets("Sheet1").Range("A1").Value = Data1
ActiveWorkbook.Worksheets("Sheet1").Range("A2").Value = Data2
ActiveWorkbook.Worksheets("Sheet1").Range("A3").Value = Data3
ActiveWorkbook.Worksheets("Sheet1").Protect Password:="your_Password"
End Sub
Hope this helps,
theDude
Bookmarks