Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
using variable in setting and ActiveCell
I would like to replace the 'a1' with a String variable I have defined
earlier in the script in the following line: ActiveCell.FormulaR1C1"=SUMIF('1a'!R6C1:R[32]C1,R5C1:R[32]C1,'1a'!R6C10:R[32]C10)" I am trying to automate the creation of summary lines on a sheet for a range of sheets in my workbook. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
using variable in setting and ActiveCell
maybe...
Dim myName as string myName = "1A" ActiveCell.FormulaR1C1 _ = "=SUMIF('" & myname & "'!R6C1:R[32]C1,R5C1:R[32]C1,'" _ & myname & "'!R6C10:R[32]C10)" Untested, uncompiled. dawall33 wrote: I would like to replace the 'a1' with a String variable I have defined earlier in the script in the following line: ActiveCell.FormulaR1C1"=SUMIF('1a'!R6C1:R[32]C1,R5C1:R[32]C1,'1a'!R6C10:R[32]C10)" I am trying to automate the creation of summary lines on a sheet for a range of sheets in my workbook. -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
using variable in setting and ActiveCell
strSheet = "1a" ActiveCell.FormulaR1C1="=SUMIF('" & strSheet & "'!R6C1:R[32]C1,R5C1:R[32]C1,'" & strSheet & "'!R6C10:R[32]C10)" -- If this post helps click Yes --------------- Jacob Skaria "dawall33" wrote: I would like to replace the 'a1' with a String variable I have defined earlier in the script in the following line: ActiveCell.FormulaR1C1"=SUMIF('1a'!R6C1:R[32]C1,R5C1:R[32]C1,'1a'!R6C10:R[32]C10)" I am trying to automate the creation of summary lines on a sheet for a range of sheets in my workbook. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
using variable in setting and ActiveCell
Something like....
Dim sVar as String sVar = "A1" ActiveCell.FormulaR1C1"=SUMIF(" & sVar & "!R6C1:R[32]C1,R5C1:R[32]C1," & sVar & "!R6C10:R[32]C10)" -- Regards, Nigel "dawall33" wrote in message ... I would like to replace the 'a1' with a String variable I have defined earlier in the script in the following line: ActiveCell.FormulaR1C1"=SUMIF('1a'!R6C1:R[32]C1,R5C1:R[32]C1,'1a'!R6C10:R[32]C10)" I am trying to automate the creation of summary lines on a sheet for a range of sheets in my workbook. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
using variable in setting and ActiveCell
Whenever you have a text String value and you want to insert the contents of
a String variable into that text String, you would break the text String at the location you want the String variable's contents to go and concatenate the String variable at that location. In your case (assuming it is the "1a" that you show in your formula that you want replaced)... ActiveCell.FormulaR1C1 "=SUMIF('" & YourVariable & _ "'!R6C1:R[32]C1,R5C1:R[32]C1,'" & _ YourVariable & "'!R6C10:R[32]C10)" Just change my example String variable name of YourVariable to your actual variable's name. Note: I used line continuation characters to avoid having your newsreader break the line at inappropriate locations... the above is really a single statement. -- Rick (MVP - Excel) "dawall33" wrote in message ... I would like to replace the 'a1' with a String variable I have defined earlier in the script in the following line: ActiveCell.FormulaR1C1"=SUMIF('1a'!R6C1:R[32]C1,R5C1:R[32]C1,'1a'!R6C10:R[32]C10)" I am trying to automate the creation of summary lines on a sheet for a range of sheets in my workbook. |
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) | |||
Setting ActiveCell color | Excel Programming | |||
Copy content of ActiveCell in a variable | Excel Programming | |||
setting range from activecell in macro | Excel Programming | |||
setting a range variable equal to the value of a string variable | Excel Programming |