I got a sheet1 that has the following information;
A BCD E F
16 Item Number Discrip. Asking Price Sold Price
17 BK-011 Test $5.00 $4.50
18 JK-112 Test2 $15.00 $15.00
The discription and asking price are pulled from sheet2 that has the information on it.
I want to have it take the sold price and fill it in on sheet2 where it got the information.
Into the column that holds the empty cell so I dont have to maually fill in the sold price is column E
so I need it to search till it finds the item number then put in the sold price for each item sold in the list off sheet1.
the lay out for sheet2 is
A= item number B= Discription C= Owners Name D=Asking Price E= Sold Price and
so on have other cells but they have formulas to do the rest.
I got the code to run but nothing is ever put into the Sold Price on sheet2 Any idea what I am missing?
here is my code
Dim ItemNumber
Dim SoldPrice
Dim Item2
'
Workbooks(1).Activate
Sheets("Sheet1".Select
Range("A17".Select
ItemNumber = ActiveCell
SoldPrice = ActiveCell.Offset(0, 4).Value
Do Until ItemNumber = ""
Workbooks(1).Activate
Range("A6".Select
Item2 = ActiveCell
Do Until Item2 = ""
If Item2 = ItemNumber Then
GoTo SETITEM
End If
ActiveCell.Offset(1, 0).Select
Item2 = ActiveCell
Loop
SETITEM:
ActiveCell.Offset(0, 5).FormulaR1C1 = SoldPrice
Application.CutCopyMode = False
ActiveCell.Rows("1:1".EntireRow.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Loop
End Sub
Thank you for your help.
J.W.
A BCD E F
16 Item Number Discrip. Asking Price Sold Price
17 BK-011 Test $5.00 $4.50
18 JK-112 Test2 $15.00 $15.00
The discription and asking price are pulled from sheet2 that has the information on it.
I want to have it take the sold price and fill it in on sheet2 where it got the information.
Into the column that holds the empty cell so I dont have to maually fill in the sold price is column E
so I need it to search till it finds the item number then put in the sold price for each item sold in the list off sheet1.
the lay out for sheet2 is
A= item number B= Discription C= Owners Name D=Asking Price E= Sold Price and
so on have other cells but they have formulas to do the rest.
I got the code to run but nothing is ever put into the Sold Price on sheet2 Any idea what I am missing?
here is my code
Dim ItemNumber
Dim SoldPrice
Dim Item2
'
Workbooks(1).Activate
Sheets("Sheet1".Select
Range("A17".Select
ItemNumber = ActiveCell
SoldPrice = ActiveCell.Offset(0, 4).Value
Do Until ItemNumber = ""
Workbooks(1).Activate
Range("A6".Select
Item2 = ActiveCell
Do Until Item2 = ""
If Item2 = ItemNumber Then
GoTo SETITEM
End If
ActiveCell.Offset(1, 0).Select
Item2 = ActiveCell
Loop
SETITEM:
ActiveCell.Offset(0, 5).FormulaR1C1 = SoldPrice
Application.CutCopyMode = False
ActiveCell.Rows("1:1".EntireRow.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Loop
End Sub
Thank you for your help.
J.W.