Hi
I have embedded a worksheet called Rawdata" into a userform. Is has a number of text boxes on the userform, all the text boxes copy correctly to a worksheet called Rawdata, however i cant get the spreadsheet data to copy from the Userform to the sheet called Datapad.
The worksheet in the userform is from A1:G600, this data needs to be copied back to the Datapad worksheet B2:F601.
Many thanks
Regards Brett
code so far: issue in red bold : Cheers!!!!!!!!
Private Sub cmdadd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("DataPad")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.ComboBox12.Value) = "" Then
Me.ComboBox12.SetFocus
MsgBox "Please enter a pallet rack number"
Exit Sub
End If
If Trim(Me.txtstore.Value) = "" Then
Me.txtstore.SetFocus
MsgBox "Please enter a store number"
Exit Sub
End If
If Trim(Me.txtdate.Value) = "" Then
Me.txtdate.SetFocus
MsgBox "Please enter a date (dd/mm/yyyy)"
Exit Sub
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.ComboBox12.Value
ws.Cells(iRow, 8).Value = Me.txtdate.Value
ws.Cells(iRow, 7).Value = Me.txtstore.Value
ws.Cells(iRow, 2).Value = Me.Rawdata.Value
'clear the data
Me.txtstore.Value = ""
Me.ComboBox12.Value = ""
ActiveWorkbook.Save
End Sub
Private Sub ComboBox12_Change()
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton4_Click()
End Sub
Private Sub CommandButton7_Click()
UserForm1.Show
End Sub
Private Sub Label24_Click()
End Sub
Private Sub txtdate_Change()
End Sub
Private Sub txtstore_Change()
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Activate()
txtdate.Text = Format(Now(), "DD/MM/YYYY")
End Sub
I have embedded a worksheet called Rawdata" into a userform. Is has a number of text boxes on the userform, all the text boxes copy correctly to a worksheet called Rawdata, however i cant get the spreadsheet data to copy from the Userform to the sheet called Datapad.
The worksheet in the userform is from A1:G600, this data needs to be copied back to the Datapad worksheet B2:F601.
Many thanks
Regards Brett
code so far: issue in red bold : Cheers!!!!!!!!
Private Sub cmdadd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("DataPad")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.ComboBox12.Value) = "" Then
Me.ComboBox12.SetFocus
MsgBox "Please enter a pallet rack number"
Exit Sub
End If
If Trim(Me.txtstore.Value) = "" Then
Me.txtstore.SetFocus
MsgBox "Please enter a store number"
Exit Sub
End If
If Trim(Me.txtdate.Value) = "" Then
Me.txtdate.SetFocus
MsgBox "Please enter a date (dd/mm/yyyy)"
Exit Sub
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.ComboBox12.Value
ws.Cells(iRow, 8).Value = Me.txtdate.Value
ws.Cells(iRow, 7).Value = Me.txtstore.Value
ws.Cells(iRow, 2).Value = Me.Rawdata.Value
'clear the data
Me.txtstore.Value = ""
Me.ComboBox12.Value = ""
ActiveWorkbook.Save
End Sub
Private Sub ComboBox12_Change()
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton4_Click()
End Sub
Private Sub CommandButton7_Click()
UserForm1.Show
End Sub
Private Sub Label24_Click()
End Sub
Private Sub txtdate_Change()
End Sub
Private Sub txtstore_Change()
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub UserForm_Activate()
txtdate.Text = Format(Now(), "DD/MM/YYYY")
End Sub