PDA

View Full Version : Find All and Replace Offset Value



youngmcc
05-25-2011, 07:11 AM
Hi

Im hoping someone can help me here.

I have an array named vArr - which is created from a range of two columns of data storing both Currencies and Exchange Rates. This will be a variable range and somedays could contain 3 members like below and other days contain 100 members.

CLP 999
HUF 666
IDR 100

vArr(1,1) is CLP and vArr(1,2) is 999
vArr(2,1) is HUF and vArr(2,2) is 666
vArr(3,1) is IDR and vArr(3,2) is 100

An example of my code is as follows:


For I = LBound(vArr) To UBound(vArr)

'The search and replace code will be in here.

Next I

I then have a list of Exchange Rate data (file attached).

I want to loop through this list and find ALL INSTANCES of member vArr(I,1) in column D and then divide the cell to the right (column E) by member vArr(I,2)

Can anyone help me on this?

Cheers

McCrimmon

Bob Phillips
05-25-2011, 07:22 AM
Your example workbook is just an example of the array data is it not?

youngmcc
05-25-2011, 07:34 AM
The attached is the data I need to find and replace.

The array that is built up is on a different workbook in a sheet named "Params"

Column D contains Currencies - CLP, HUF and IDR
Column E contains Factors - 999, 666 and 100

I basically want to loop down the attached example and find all instances of CLP and replace the values in column E by dividing that number by 999.

After this I would then loop to the next array member and find all instances of HUF and replace the values in column E by dividing that number 666.

The same again would apply to array member IDR replacing the values by dividing by 100.

Hope that makes more sense.