Here's a basic way to do it. Just add questions for each column you wish to collect. The macro will loop so you can enter multiple rows of data, then offer to print the sheet when done.
You willl need to edit the sheet name:
Option Explicit
Sub MacroQuestions()
Dim NR As Long
With Sheets("Form")
Do
NR = .Range("A" & .Rows.Count).End(xlUp).Row + 1 'get the next empty row #
.Range("A" & NR).Value = Application.InputBox("First Name", "First Name", Type:=2)
.Range("B" & NR).Value = Application.InputBox("Last Name", "Last Name", Type:=2)
.Range("C" & NR).Value = Application.InputBox("Email", "Email", "[email protected]", Type:=2)
.Range("D" & NR).Value = Application.InputBox("Cell Phone", "Cell Phone", "999-999-9999", Type:=2)
'add more as needed
Loop Until MsgBox("Enter another?", vbYesNo, "Repeat") = vbNo
.Columns.AutoFit
If MsgBox("Print the FORM database?", vbYesNo) = vbYes Then .PrintOut 1
End With
End Sub
Obviously this is print out a row-based database sheet. If your form is more of an actual FORM, then remove the NR stuff and enter the exact cell addresses where you want to enter the values since those WON'T be variable.
Bookmarks