PDA

View Full Version : multiply loop at once



amateur1902
02-29-2008, 08:41 AM
Hello everyone,

Is het possibel to perform 1 loop for more objects or do i have to loop sepperetly.


Range("F18").Select
ActiveCell.FormulaR1C1 = "=Proper(BDP(RC[-2],""name""))"
Range("N18").Select
ActiveCell.FormulaR1C1 = "=BDP(RC[-10],""VOLUME_AVG_30D"")"
Range("P18").Select
ActiveCell.FormulaR1C1 = "=BDP(RC[-12],""px last"")"
Range("r18").Select
ActiveCell.FormulaR1C1 = "=BDP(RC[-14],""CHG_PCT_1D"")/100"

Bob Phillips
02-29-2008, 09:05 AM
You are not clear, but that can be better written as



Range("F18").FormulaR1C1 = "=Proper(BDP(RC[-2],""name""))"
Range("N18").FormulaR1C1 = "=BDP(RC[-10],""VOLUME_AVG_30D"")"
Range("P18").FormulaR1C1 = "=BDP(RC[-12],""px last"")"
Range("r18").FormulaR1C1 = "=BDP(RC[-14],""CHG_PCT_1D"")/100"

amateur1902
02-29-2008, 09:17 AM
I am sorry.

I understand what i have to do know. But the only thing that i don't know is how to put a variable in as range.

Thanks

Bob Phillips
02-29-2008, 09:24 AM
For example



myColOffset = -10
Range("N18").FormulaR1C1 = "=BDP(RC[" & myColOffset & "],""VOLUME_AVG_30D"")"