I have 3 spreadsheets. One form to enter the information, and two different spreadsheets that the information goes into (9月Spares, 9月Project). I have an activex button and two options and to be honest I'm kind of experimenting with them. The code executes if you click the "Enter" Button.
If it Spares is selected, the info should go into the Spares spreadsheet. But I keep getting a application/object defined error when I try select one of the sheet's range. I have no idea why!
Thanks so much in advance!
If it Spares is selected, the info should go into the Spares spreadsheet. But I keep getting a application/object defined error when I try select one of the sheet's range. I have no idea why!
Code:
Private Sub Input_Button_Click()
Dim data As Range
Dim spwksh As Worksheet
Dim pjwksh As Worksheet
Set data = Sheets("Plugin Form").Range("A32:GX32")
Set spwksh = Sheets("9月Spares")
Set pjwksh = Sheets("9月Project")
Range("A32").Value = TextBox_Cusname
Range("C32").Value = TextBox_InvoiceNum
Range("D32").Value = TextBox_Sales
Range("F32").Value = TextBox_Cost
If Select_SpareParts.Value = True Then
spwksh.Range("A5").Activate
End If
If Select_Projects.Value = True Then
pjwksh.Range("A5").Activate
End If
End Sub
Thanks so much in advance!