Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing 2 cells in a macro
I've got the following code which I am trying to add the following 2 columns
thru cell refences and am getting a compile error. I am not sure what I am doing wrong since it works when I only reference 1 column. Worksheets(Sh).Range("W" & X).FormulaR1C1 = "=((RC[" & Sheet(1).Range("D32")+ RC[" & Sheet(1).Range("E32")& "]/Sheet1!R21C4*52)" -- Thanks. Bob |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing 2 cells in a macro
Hi Bob,
Ken again. You are missing a quote before the RC in the second line of the your posted code. Sheet(1).Range("D32")+ "RC[" & Sheet(1).Range("E32")& "]/Sheet1!R21C4*52)" -- Ken Hudson "Bob" wrote: I've got the following code which I am trying to add the following 2 columns thru cell refences and am getting a compile error. I am not sure what I am doing wrong since it works when I only reference 1 column. Worksheets(Sh).Range("W" & X).FormulaR1C1 = "=((RC[" & Sheet(1).Range("D32")+ RC[" & Sheet(1).Range("E32")& "]/Sheet1!R21C4*52)" -- Thanks. Bob |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing 2 cells in a macro
Hi Ken,
I re-ran the code and came up with a "Type Mismatch" error. Not sure why Worksheets(Sh).Range("W" & X) = "=((RC[" & Sheets(1).Range("D32") + "RC[" & Sheets(1).Range("E32") & "]/Sheet1!R25C4*52)" Thanks. Bob Worksheets(Sh).Range("W" & X) = "=((RC[" & Sheets(1).Range("D32") + "RC[" & Sheets(1).Range("E32") & "]/Sheet1!R25C4*52" -- Bob "Ken Hudson" wrote: Hi Bob, Ken again. You are missing a quote before the RC in the second line of the your posted code. -- Ken Hudson "Bob" wrote: I've got the following code which I am trying to add the following 2 columns thru cell refences and am getting a compile error. I am not sure what I am doing wrong since it works when I only reference 1 column. Worksheets(Sh).Range("W" & X).FormulaR1C1 = "=((RC[" & Sheet(1).Range("D32")+ RC[" & Sheet(1).Range("E32")& "]/Sheet1!R21C4*52)" -- Thanks. Bob |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing 2 cells in a macro
Thanks - I got it to run.
-- Bob "Bob" wrote: Hi Ken, I re-ran the code and came up with a "Type Mismatch" error. Not sure why Worksheets(Sh).Range("W" & X) = "=((RC[" & Sheets(1).Range("D32") + "RC[" & Sheets(1).Range("E32") & "]/Sheet1!R25C4*52)" Thanks. Bob Worksheets(Sh).Range("W" & X) = "=((RC[" & Sheets(1).Range("D32") + "RC[" & Sheets(1).Range("E32") & "]/Sheet1!R25C4*52" -- Bob "Ken Hudson" wrote: Hi Bob, Ken again. You are missing a quote before the RC in the second line of the your posted code. -- Ken Hudson "Bob" wrote: I've got the following code which I am trying to add the following 2 columns thru cell refences and am getting a compile error. I am not sure what I am doing wrong since it works when I only reference 1 column. Worksheets(Sh).Range("W" & X).FormulaR1C1 = "=((RC[" & Sheet(1).Range("D32")+ RC[" & Sheet(1).Range("E32")& "]/Sheet1!R21C4*52)" -- Thanks. Bob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
referencing cells based on conditions in other cells | Excel Discussion (Misc queries) | |||
Referencing the same cells | Excel Discussion (Misc queries) | |||
Referencing cells | New Users to Excel | |||
referencing previously selected cells after macro execution begins | Excel Programming | |||
Referencing Cells | Excel Programming |