W
waveracerr
Seems simple enough but I cannot find any help on the matter...
I cannot get the required syntax to allow me to use a variable, "i",
within the formula, "=RC[-1]&""/""&RC[&i]"
Sub Macro1()
Dim i As Integer
i = 2
Range("D2").Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=RC[-1]&""/""&RC[&i]"
ActiveCell.Offset(0, 1).Select
i = -2 + i
Loop
End Sub
Column headings exist in every other column along row 2. I want the
formula to pick up the heading in C2 every time, add a division sign
and then add the heading from the preceding column.
For example if C2's heading reads "Animal", D2's heading reads "Plant"
and F2's heading reads "Fungi". In this example I want the formula to
print "Animal/Plant" in E2 and "Animal/Fungi" in G2.
Thanks for any help!
Ryan
I cannot get the required syntax to allow me to use a variable, "i",
within the formula, "=RC[-1]&""/""&RC[&i]"
Sub Macro1()
Dim i As Integer
i = 2
Range("D2").Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=RC[-1]&""/""&RC[&i]"
ActiveCell.Offset(0, 1).Select
i = -2 + i
Loop
End Sub
Column headings exist in every other column along row 2. I want the
formula to pick up the heading in C2 every time, add a division sign
and then add the heading from the preceding column.
For example if C2's heading reads "Animal", D2's heading reads "Plant"
and F2's heading reads "Fungi". In this example I want the formula to
print "Animal/Plant" in E2 and "Animal/Fungi" in G2.
Thanks for any help!
Ryan