Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userform copy data to more than one location


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userform copy data to more than one location


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userform copy data to more than one location


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userform copy data to more than one location


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userform copy data to more than one location


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default userform copy data to more than one location


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prompt for file location and copy data Jim G Excel Discussion (Misc queries) 0 February 27th 07 02:47 AM
Date / Time Picker V6.0 - Control moves location on userform! Mark Excel Programming 0 October 3rd 05 03:28 PM
Copy to Location GregR Excel Discussion (Misc queries) 5 July 1st 05 04:26 PM
if statement is true, copy data to another location janco tianno Excel Programming 2 June 30th 04 09:37 PM
Userform Screen Location Don A. Excel Programming 2 July 30th 03 10:58 PM


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"