ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using stored variable in a formula (https://www.excelbanter.com/excel-programming/397259-using-stored-variable-formula.html)

tc

Using stored variable in a formula
 
Hi. i have managed to store the active sheet name in a variable. how
do i use this variable in a formula?


joel

Using stored variable in a formula
 
Here is what the formula look like in the spreadsheet

=SUM(Sheet2!A1:A5)

To generate this in VBA

MySheetName = "Sheet2"

Range("A1").formula = "=SUM(" & MySheetName & "!A1:A5)"

"tc" wrote:

Hi. i have managed to store the active sheet name in a variable. how
do i use this variable in a formula?



JE McGimpsey

Using stored variable in a formula
 
What formula?



In article .com,
tc wrote:

Hi. i have managed to store the active sheet name in a variable. how
do i use this variable in a formula?



All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com