Importing updated prices

cornjoelio

New Member
Joined
Jul 26, 2017
Messages
2
Hi there, some help please. I have tried searching for an answer but I can't seem to find the right search terms to return the answer I need.

I have two tables, for example:

Price List
Product IDPrice
10001$1.30
10002$5.10
10003$0.85
10004$0.99
10005$2.00
10006$9.99

<tbody>
</tbody>













Price Updates
Product IDPrice
10002$6.00
10003$1.00
10006$12.99

<tbody>
</tbody>








I need to do this on a much larger scale, e.g. 200 price changes out of 18000 products. Is there a function that will easily allow me to update the prices in Price List with those that appear in Price Updates?

My amateur workaround involved creating a new column in Price List called Price Import with which to VLOOKUP the prices, filtering out the blanks, copying over the new prices into the Prices column and then deleting the Price Import column. I'd be glad to know of a more advanced solution!

Many thanks
Joel
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Hi,
I think this what you may be looking for.
In your price import column Put this formula in.
Code:
=IFERROR(INDEX('Price Updates'!$A$2:$B$4,MATCH(A2,'Price Updates'!$A$2:$A$4,0),2),B2)
 
Last edited:
Upvote 0
You can run the macro to update the prices. This assumes that the price list has headers in row 1 with product id in column A and price in B and the same with the new price list. Change the sheet names and ranges to match your data.

Code:
Sub priceupdate()
Dim lr As Long
Dim wsoldp As Worksheet
Dim wsnewp As Worksheet
Set wsoldp = Sheets("Sheet1")[COLOR=#00FF00] 'sheet with price list[/COLOR]
Set wsnewp = Sheets("sheet2") [COLOR=#00FF00]'sheet with new prices[/COLOR]
lro = wsoldp.Cells(Rows.Count, 1).End(xlUp).Row
lrn = wsnewp.Cells(Rows.Count, 1).End(xlUp).Row

For x = 2 To lro 'price list starts in row 2 with headers in row 1. If list starts in different row then change 2 to the row it starts in
    Change = Application.Index(wsnewp.Range("B2:B" & lrn), Application.Match(wsoldp.Cells(x, 1), wsnewp.Range("A2:A" & lrn), 0))
    If IsNumeric(Change) Then
        [COLOR=#00FF00]'new price[/COLOR]
        wsoldp.Cells(x, 2) = Change
    Else
        [COLOR=#00FF00]'no new price[/COLOR]
    End If
Next x
End Sub
 
Last edited:
Upvote 0
Hi,

a pritty fast method should be to load table 1 in a dictionary and then replace the prices (items) with table 2.

regards
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,550
Members
449,237
Latest member
Chase S

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top