I'm very new to VBA having only taught myself a little using youtube videos and trial and error. Please be very descriptive and do not assume anything when answering.
I have a code written that is suppose to take data submitted using a command button on sheet1 and store the information on the next blank row of sheet2. The code I have works great the first time, but it will not fill in below it the next time I use it. I get an error 1004 code at the if statement. Please help.
Private Sub CommandButton21_Click()
Dim Location As String, EmployeeName As String, itemnumber As Long, color As String, size As String, embloc As String, secopt As String, secplace As String, embstyle As String, lettering As String
Worksheets("sheet1").Select
Location = Range("e7")
EmployeeName = Range("e8")
itemnumber = Range("e9")
color = Range("e10")
size = Range("e11")
embloc = Range("e12")
secopt = Range("e13")
secplace = Range("e14")
embstyle = Range("e15")
lettering = Range("e16")
Worksheets("sheet2").Select
Worksheets("sheet2").Range("b3").Select
If Worksheets("sheet2").Range("B3").Offset(1, 0) <> "" Then
Worksheets("sheet2").Range("B3").End(x1down).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = Location
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = EmployeeName
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = itemnumber
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = color
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = size
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = embloc
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = secopt
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = secplace
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = embstyle
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = lettering
Worksheets("sheet1").Select
Worksheets("sheet1").Range("e7:e16").ClearContents
Worksheets("sheet1").Range("e7").Select
End Sub
It won't let me post photos on here yet, but i have a table on sheet 2 that has headings from B3 to K3.