So I re-thought my Userform data transfer to the worksheet. I previously had a workbook that would save my "quotes" and move all the info over to the register and would change the quote number as it was saved. It would count up by one on "Quote" worksheet so the every time the worksheet saved and the register would move to the next line. What I would like to do have the same coding to work with the Userform. I want the Userform to save and transfer over to the register, and wanted Column A to be a hyperlink so if clicked it would take the counterman to directly to "Sales" sheet.. This is what I have so far but I don't know how to set the Userform like I would a worksheet... I read that you set it as an object but I can't figure out how to do that.. This is the code I have so far and it errors out on the "set ws1 = ?. I have not made it to the hyperlink to know if that works.. Hopefully someone knows how to do this..
Code:
Private Sub CommandButton5_Click() Dim ws1 As Object
Dim ws2 As Worksheet
Set ws1 = UserForm
Set ws2 = Worksheets("Quotes")
nextrow = ws2.Cells(Rows.Count, 1).End(xlUp).Row + 1
ws2.Cells(nextrow, 1).Resize(1, 16).Value = Array(ws1.Range("QuoteNumber"), ws1.Range("Date1"), ws1.Range("Year" + " " + "Make" + " " + "Model"), ws1.Range("size"), ws1.Range("ComboBox1"), ws1.Range("Cost"), ws1.Range("custNumber"), ws1.Range("Company"), ws1.Range("FirstName" + " " + "LastName"), ws1.Range("phone1"), ws1.Range("City"), ws1.Range("State"), ws1.Range("ZipCode"), ws1.Range("email"), ws1.Range("Initals"))
With ws2
.Hyperlinks.Add Anchor:=.Range("A" & nextrow), Address:=Sheets("Sales")
End With
End Sub