G
Guest
I have a macro which opens workbooks and checks for the existance of Sheet1.
If sheet 1 is there, I want to populate other fields in the active workbook
from the open workbook.
I have the following equations I want to use:
Range("BW2").Select
ActiveCell.FormulaR1C1 = _
"=MATCH(RC[-2],'[Book1.xls]Sheet1'!R33)"
Range("BX2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R1C,'[Book1.xls]Sheet1'!R1:R50,RC75,FALSE)"
Range("BY2").Select
1) Is there a more elegant way to write these equations?
2) How do I ensure that I get the value in the active cell of the active
workbook, not the equation?
3) Book1.xls is from column G of the workbook. I have a For/Next loop
going from the first to the last book I'm evaluating with the counter being
i.
How would I rewrite these equations to get what I want?
Thanks in advance for your assistance.
Barb Reinhardt
If sheet 1 is there, I want to populate other fields in the active workbook
from the open workbook.
I have the following equations I want to use:
Range("BW2").Select
ActiveCell.FormulaR1C1 = _
"=MATCH(RC[-2],'[Book1.xls]Sheet1'!R33)"
Range("BX2").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(R1C,'[Book1.xls]Sheet1'!R1:R50,RC75,FALSE)"
Range("BY2").Select
1) Is there a more elegant way to write these equations?
2) How do I ensure that I get the value in the active cell of the active
workbook, not the equation?
3) Book1.xls is from column G of the workbook. I have a For/Next loop
going from the first to the last book I'm evaluating with the counter being
i.
How would I rewrite these equations to get what I want?
Thanks in advance for your assistance.
Barb Reinhardt