PDA

View Full Version : Solved: Distributing data among sheets



san_son
08-08-2007, 01:59 AM
Hi , The problem seems to be a bit complex , i have a userform with comboboxes for items and their number, and i have a named range for items cost and description , now depending on the items selected from the combobox and no of items selected from it , i want to use the itemsbox value to find the cost and then copy it to a new location and then in the next column add the number of items and finally put the total value . hope that is clear , what is the best methode to achieve this .

rory
08-08-2007, 03:58 AM
It would be easier to see a sample workbook (use the Go Advanced button and select Manage Attachments) to see where the data is coming from and where it should go. The code itself shouldn't be too complicated.

san_son
08-08-2007, 04:23 AM
Hi

i have tried to explain some details in the pdf , as the application is too big to be enclosed

rory
08-08-2007, 04:42 AM
What do the 837 and 1674 represent? Is 1674 the cost?
You basically want something along these lines:

Dim varData
Dim lngRow as Long
lngRow = Sheets("output sheet name").Range("A65536").end(xlUp).Row + 1
varData = Application.Match(cboModuleName, Range("datatable").Columns(1),0)
If Not IsError(varData) Then
with Sheets("output sheet name")
.Cells(lngRow, "A") = cboModuleName
.Cells(lngRow, "B") = Range("Datatable").Cells(varData, 2)
.Cells(lngRow, "C") = Range("Datatable").Cells(varData, 3)
.Cells(lngrow, "D") = cboQuantity
.Cells(lngRow, "E").FormulaR1C1 = "=RC[-2]*RC[-1]"
End With
End If


but it's hard to be specific without knowing any of your control or sheet names.

san_son
08-08-2007, 04:54 AM
ACTUALLY THE FIRST TWO ENTRIES , 837 AND 1674 ARE THE COSTS IN TWO DIFFERENT CURRENCIES , I THINK YOUR IDEA IS OF GREAT HELP TO ME . THANKS ,

LET ME APPLY THIS AND WILL REVERT BACK TO YOU

san_son
08-12-2007, 09:27 PM
Thanks a lot , that solves my problem