I have two worksheets
- Source(ThisWorkbook) - contains multiple worksheets
- Destination(WBD) - contains 1 worksheet
This is the process:
- Compare each cell from a range in WBD (B2:B6) to all worksheet names in ThisWorkbook
- If a match is found, from a range in WBD (C2:C7) and look for it in the matched worksheet
- (this is where I'm having troubles)How do I get the value of the avg price cell? Do I need another loop?
*the distance between type and price is consistent.
Here's what I got so far:
For Each cel In WBD.Worksheets(1).Range("B2:B6")
For Each ws In ThisWorkbook.Worksheets
ws.Activate
If ws.Name = cel.Value Then
'find C2:C7 , offset, copy avg price, paste
Next ws
Next cel
Source - ThisWorkbook
Destination - WBD