Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I use a variable in the place of a sheet name
In the following code snippet, from a macro I am writing, how do I use
name as a variable rather than a predefined sheet name in this code line - ActiveCell.Offset(row, col).FormulaR1C1 = "=name!RC*1.0" Sample code snippet from my Excel macro Do While ActiveCell.Offset(0, col) < "" row = 2 Do While ActiveCell.Offset(row, col - 1) < "" ActiveCell.Offset(row, col).FormulaR1C1 = "=name!RC*1.0" row = row + 1 Loop DoEvents col = col + 1 Loop |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I use a variable in the place of a sheet name
ActiveCell.Offset(row, col).FormulaR1C1 = "=" & name & "!RC*1.0"
-- Kind regards, Niek Otten "FCLinux" wrote in message om... In the following code snippet, from a macro I am writing, how do I use name as a variable rather than a predefined sheet name in this code line - ActiveCell.Offset(row, col).FormulaR1C1 = "=name!RC*1.0" Sample code snippet from my Excel macro Do While ActiveCell.Offset(0, col) < "" row = 2 Do While ActiveCell.Offset(row, col - 1) < "" ActiveCell.Offset(row, col).FormulaR1C1 = "=name!RC*1.0" row = row + 1 Loop DoEvents col = col + 1 Loop |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I use a variable in the place of a sheet name
Good Morning,
if name variable is s string type variable, this should do the trick for you.. enjoy, Rick Dim name as string ActiveCell.Offset(row, col).FormulaR1C1 = "=" & name" & "!RC*1.0" "FCLinux" wrote in message om... In the following code snippet, from a macro I am writing, how do I use name as a variable rather than a predefined sheet name in this code line - ActiveCell.Offset(row, col).FormulaR1C1 = "=name!RC*1.0" Sample code snippet from my Excel macro Do While ActiveCell.Offset(0, col) < "" row = 2 Do While ActiveCell.Offset(row, col - 1) < "" ActiveCell.Offset(row, col).FormulaR1C1 = "=name!RC*1.0" row = row + 1 Loop DoEvents col = col + 1 Loop |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I pull data from one sheet and place it in another? | Excel Discussion (Misc queries) | |||
Use a range value in place of sheet name | Excel Discussion (Misc queries) | |||
VBA to place sheet name in cell | Excel Programming | |||
Is there a formula that will place the sheet name in a cell? | Excel Worksheet Functions | |||
how to place a variable cell into a range? | Excel Programming |