I have a userform which currently adds new products to a price lis
which consist of *process,product description,product code,unit o
measure,price per unit* which is located on one workshee
(ProductPriceList), on another worksheet (ProductData) I have 5 column
(a-e) which have headings for 5 different processes, these column
contain unique product descriptions for each of the processes, I us
these for dependant data validation lists, I would really appreciate i
someone can help with code that will add the product description for th
new product to the appropriate process column on workshee
(ProductData). Here is the code I have presently to add the product t
the price list :
Private Sub cmdAdd_Click()
Dim lRow As Long
Dim lPart As Long
Dim ws As Worksheet
Set ws = Worksheets("ProductPriceList")
'find first empty row in database
lRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a process
If Trim(Me.cmbProcess.Value) = "" Then
Me.cmbProcess.SetFocus
MsgBox "Please enter a process"
Exit Sub
End If
'copy the data to the database
With ws
.Cells(lRow, 1).Value = Me.cmbProcess.Value
.Cells(lRow, 2).Value = Me.txtDescription.Value
.Cells(lRow, 3).Value = Me.txtCode.Value
.Cells(lRow, 4).Value = Me.txtUnit.Value
.Cells(lRow, 5).Value = Me.txtPrice.Value
End With
'clear the data
Me.cmbProcess.Value = ""
Me.txtDescription.Value = ""
Me.txtCode.Value = ""
Me.txtUnit.Value = ""
Me.txtPrice.Value = ""
Me.cmbProcess.SetFocus
End Su
--
apnda
-----------------------------------------------------------------------
apndas's Profile:
http://www.excelforum.com/member.php...fo&userid=3613
View this thread:
http://www.excelforum.com/showthread.php?threadid=55911