O
oberon.black
need help specifing cells that I want info to go in.
Code
-------------------
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("") *'I want this to be the active sheet*
'check for a part number
If Trim(Me.a.Value) = "" Then
Me.a.SetFocus
MsgBox "Please enter a"
Exit Sub
End If
'copy the data to the database
ws.Cells('the column and row/cell name).Value = Me.a.Value ""
ws.Cells('the column and row/cell name).Value = Me.c.Value ""
ws.Cells('the column and row/cell name).Value = Me.s.Value ""
ws.Cells('the column and row/cell name).Value = Me.z.Value ""
ws.Cells('the column and row/cell name).Value = Me.mlast.Value ""
ws.Cells('the column and row/cell name).Value = Me.mfirst.Value ""
ws.Cells('the column and row/cell name).Value = Me.mmail.Value = ""
ws.Cells('the column and row/cell name).Value = Me.mhome.Value ""
ws.Cells('the column and row/cell name).Value = Me.mme.Value ""
ws.Cells('the column and row/cell name).Value = Me.mwork.Value ""
ws.Cells('the column and row/cell name).Value = Me.mrk.Value ""
ws.Cells('the column and row/cell name).Value = Me.mcell.Value ""
ws.Cells('the column and row/cell name).Value = Me.mll.Value ""
ws.Cells('the column and row/cell name).Value = Me.flast.Value ""
ws.Cells('the column and row/cell name).Value = Me.ffirst.Value ""
ws.Cells('the column and row/cell name).Value = Me.fmail.Value ""
ws.Cells('the column and row/cell name).Value = Me.fhome.Value ""
ws.Cells('the column and row/cell name).Value = Me.fme.Value ""
ws.Cells('the column and row/cell name).Value = Me.fwork.Value ""
ws.Cells('the column and row/cell name).Value = Me.frk.Value ""
ws.Cells('the column and row/cell name).Value = Me.fcell.Value ""
ws.Cells('the column and row/cell name).Value = Me.fll.Value ""
'clear the data
Me.a.Value = ""
Me.c.Value = ""
Me.s.Value = ""
Me.z.Value = ""
Me.mlast.Value = ""
Me.mfirst.Value = ""
Me.mmail.Value = ""
Me.mhome.Value = ""
Me.mme.Value = ""
Me.mwork.Value = ""
Me.mrk.Value = ""
Me.mcell.Value = ""
Me.mll.Value = ""
Me.flast.Value = ""
Me.ffirst.Value = ""
Me.fmail.Value = ""
Me.fhome.Value = ""
Me.fme.Value = ""
Me.fwork.Value = ""
Me.frk.Value = ""
Me.fcell.Value = ""
Me.fll.Value = ""
Me.a.SetFocus
End Sub
-------------------
Want must I do to this code to make it work. So that I can tell th
text box to enter the userform info into different cells as I see fit.
Than
Code
-------------------
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("") *'I want this to be the active sheet*
'check for a part number
If Trim(Me.a.Value) = "" Then
Me.a.SetFocus
MsgBox "Please enter a"
Exit Sub
End If
'copy the data to the database
ws.Cells('the column and row/cell name).Value = Me.a.Value ""
ws.Cells('the column and row/cell name).Value = Me.c.Value ""
ws.Cells('the column and row/cell name).Value = Me.s.Value ""
ws.Cells('the column and row/cell name).Value = Me.z.Value ""
ws.Cells('the column and row/cell name).Value = Me.mlast.Value ""
ws.Cells('the column and row/cell name).Value = Me.mfirst.Value ""
ws.Cells('the column and row/cell name).Value = Me.mmail.Value = ""
ws.Cells('the column and row/cell name).Value = Me.mhome.Value ""
ws.Cells('the column and row/cell name).Value = Me.mme.Value ""
ws.Cells('the column and row/cell name).Value = Me.mwork.Value ""
ws.Cells('the column and row/cell name).Value = Me.mrk.Value ""
ws.Cells('the column and row/cell name).Value = Me.mcell.Value ""
ws.Cells('the column and row/cell name).Value = Me.mll.Value ""
ws.Cells('the column and row/cell name).Value = Me.flast.Value ""
ws.Cells('the column and row/cell name).Value = Me.ffirst.Value ""
ws.Cells('the column and row/cell name).Value = Me.fmail.Value ""
ws.Cells('the column and row/cell name).Value = Me.fhome.Value ""
ws.Cells('the column and row/cell name).Value = Me.fme.Value ""
ws.Cells('the column and row/cell name).Value = Me.fwork.Value ""
ws.Cells('the column and row/cell name).Value = Me.frk.Value ""
ws.Cells('the column and row/cell name).Value = Me.fcell.Value ""
ws.Cells('the column and row/cell name).Value = Me.fll.Value ""
'clear the data
Me.a.Value = ""
Me.c.Value = ""
Me.s.Value = ""
Me.z.Value = ""
Me.mlast.Value = ""
Me.mfirst.Value = ""
Me.mmail.Value = ""
Me.mhome.Value = ""
Me.mme.Value = ""
Me.mwork.Value = ""
Me.mrk.Value = ""
Me.mcell.Value = ""
Me.mll.Value = ""
Me.flast.Value = ""
Me.ffirst.Value = ""
Me.fmail.Value = ""
Me.fhome.Value = ""
Me.fme.Value = ""
Me.fwork.Value = ""
Me.frk.Value = ""
Me.fcell.Value = ""
Me.fll.Value = ""
Me.a.SetFocus
End Sub
-------------------
Want must I do to this code to make it work. So that I can tell th
text box to enter the userform info into different cells as I see fit.
Than