Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Your code works. I get this error if I don't have a sheet i ThisWorkbook called "ProductPriceList" - is your spelling OK? Co -- colofnatur ----------------------------------------------------------------------- colofnature's Profile: http://www.excelforum.com/member.php...fo&userid=3435 View this thread: http://www.excelforum.com/showthread.php?threadid=55911 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Col the spelling is correct, and it works fine presently, so i'm not sure what's happening your end, I'm a newbie to VBA, maybe my workbook structure is not set up correctly, would it be more helpful if I attached the workbook -- apndas ------------------------------------------------------------------------ apndas's Profile: http://www.excelforum.com/member.php...o&userid=36137 View this thread: http://www.excelforum.com/showthread...hreadid=559116 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() worries< -- colofnatur ----------------------------------------------------------------------- colofnature's Profile: http://www.excelforum.com/member.php...fo&userid=3435 View this thread: http://www.excelforum.com/showthread.php?threadid=55911 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Cool - top tip: replace @ with and any dots with spaces so you don't ge loads of spam in yor email eaddress if you replay to this, or PM me an I'll do what I can to help... -- colofnatur ----------------------------------------------------------------------- colofnature's Profile: http://www.excelforum.com/member.php...fo&userid=3435 View this thread: http://www.excelforum.com/showthread.php?threadid=55911 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() before I attach the file - assuming that my current code is working ok do you have any suggestions as to the additional task I'm wanting t perform, would you just add it to the current code??? Regards Darre -- apnda ----------------------------------------------------------------------- apndas's Profile: http://www.excelforum.com/member.php...fo&userid=3613 View this thread: http://www.excelforum.com/showthread.php?threadid=55911 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Prompt for file location and copy data | Excel Discussion (Misc queries) | |||
Date / Time Picker V6.0 - Control moves location on userform! | Excel Programming | |||
Copy to Location | Excel Discussion (Misc queries) | |||
if statement is true, copy data to another location | Excel Programming | |||
Userform Screen Location | Excel Programming |