Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveCell.Formula
Hello,
Does anyone know how to (inVBA) create Range("B5").Select ActiveCell.FormulaR1C1 = "=Test1!R[-3]C[2]" Range("A4").Select Where Test1 can be a variable. I want to be able to enter formulas in cells but I want to be able to use variables in the formulas. I do not want to use UDF's so that the user can see the actual formula used to obtain the result when that particular cell is active. Thank you. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveCell.Formula
s1 = "Test1"
Range("B5").Select ActiveCell.FormulaR1C1 = "=" & S1 & "!R[-3]C[2]" Range("A4").Select or s1 = "Test1" r1 = -3 c1 = 2 Range("B5").Select ActiveCell.FormulaR1C1 = "=" & S1 & "!R[" & r1 & "]C[" & c1 & "]" Range("A4").Select demo'd from the immediate window: s1 = "Test1" r1 = -3 c1 = 2 ? "=" & S1 & "!R[" & r1 & "]C[" & c1 & "]" =Test1!R[-3]C[2] -- Regards, Tom Ogilvy "Matt P." wrote in message ... Hello, Does anyone know how to (inVBA) create Range("B5").Select ActiveCell.FormulaR1C1 = "=Test1!R[-3]C[2]" Range("A4").Select Where Test1 can be a variable. I want to be able to enter formulas in cells but I want to be able to use variables in the formulas. I do not want to use UDF's so that the user can see the actual formula used to obtain the result when that particular cell is active. Thank you. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ActiveCell.Formula
Thanks again Tom.
-----Original Message----- s1 = "Test1" Range("B5").Select ActiveCell.FormulaR1C1 = "=" & S1 & "!R[-3]C[2]" Range("A4").Select or s1 = "Test1" r1 = -3 c1 = 2 Range("B5").Select ActiveCell.FormulaR1C1 = "=" & S1 & "!R[" & r1 & "]C[" & c1 & "]" Range("A4").Select demo'd from the immediate window: s1 = "Test1" r1 = -3 c1 = 2 ? "=" & S1 & "!R[" & r1 & "]C[" & c1 & "]" =Test1!R[-3]C[2] -- Regards, Tom Ogilvy "Matt P." wrote in message ... Hello, Does anyone know how to (inVBA) create Range("B5").Select ActiveCell.FormulaR1C1 = "=Test1!R[-3]C[2]" Range("A4").Select Where Test1 can be a variable. I want to be able to enter formulas in cells but I want to be able to use variables in the formulas. I do not want to use UDF's so that the user can see the actual formula used to obtain the result when that particular cell is active. Thank you. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
ActiveCell.Formula and IF statement | Excel Programming | |||
ActiveCell.Formula Syntax | Excel Programming | |||
activecell.formula syntax | Excel Programming | |||
Formula with an ActiveCell | Excel Programming |