AnteChristo33
New Member
- Joined
- Nov 13, 2021
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Greetings,
Need some help with an automation script - possibly a loop with variant arrays? Couldn't put it in practice, but it seems to be the consensus for faster data parsing.
I've got a convoluted 25 sheet workbook that we use to determine the price for certain products. The Product Names are "modular" and the pricing is determined by the "modules" in the name, eg. (ABC-DE-FGH) Lots of complicated formulas in there and no one has the full price list. I did find the Product List, however.
We're digging into the Lookup Sheet and the Product List Sheet.
My goal is to take that list of Product Names, input them (one by one?) in the lookup field, copy the calculated price onto the Product List Sheet and go down the list like so.
When the Product Name is input in the Lookup Field, the price has to be calculated via a ready-made formula.
The Hitch : There's over 100k Product Names and this attempt at a code takes way too long.
I've illustrated how the problem looks with a Test File and these images.
I do hope it helps in formulating a viable plan! I'm eager to learn the inner workings of a potential solution.
Thanks
Need some help with an automation script - possibly a loop with variant arrays? Couldn't put it in practice, but it seems to be the consensus for faster data parsing.
I've got a convoluted 25 sheet workbook that we use to determine the price for certain products. The Product Names are "modular" and the pricing is determined by the "modules" in the name, eg. (ABC-DE-FGH) Lots of complicated formulas in there and no one has the full price list. I did find the Product List, however.
We're digging into the Lookup Sheet and the Product List Sheet.
My goal is to take that list of Product Names, input them (one by one?) in the lookup field, copy the calculated price onto the Product List Sheet and go down the list like so.
When the Product Name is input in the Lookup Field, the price has to be calculated via a ready-made formula.
The Hitch : There's over 100k Product Names and this attempt at a code takes way too long.
VBA Code:
Sub Copy_Price()
Dim i As Long
For i = 2 To Range("A1").End(xlDown).Row
Worksheets("Lookup Sheet").Range("A2").Value = Worksheets("Product List").Range("A" & i)
Worksheets("Lookup Sheet").Range("B2").Copy
Worksheets("Product List").Range("C" & i).PasteSpecial Paste:=xlPasteValues
Next i
End Sub
I've illustrated how the problem looks with a Test File and these images.
I do hope it helps in formulating a viable plan! I'm eager to learn the inner workings of a potential solution.
Thanks