My question must have been unclear indeed :-), I am not trying to show/hide sheets, I'am trying to
populate a variable that is per sheet and not global (as they are by default to my understanding.)
variable vMyvar = 'adam' on sheet1 - but on sheet2 same variable (or to be correct a variable with the same name) has value 'eve' assigned.
I think this can help you out...
- Reference to an individual cell: Sheet_name!Cell_address
For example, to refer to cell A1 in Sheet2, you type Sheet2!A1.
- Reference to a range of cells: Sheet_name!First_cell:Last_cell
For example, to refer to cells A1:A10 in Sheet2, you type Sheet2!A1:A10.
Creating a reference to another sheet in Excel
When writing a formula that refers to cells in another worksheet, you can of course type that other sheet name followed by an exclamation point and a cell reference manually, but this would be a slow and error-prone way.
- A better way is point to the cell(s) in another sheet that you want the formula to refer to,
- Let Excel take care of the correct syntax of your sheet reference.
To have Excel insert a reference to another sheet in your formula, do the following:
- Start typing a formula either in a destination cell or in the formula bar.
- When it comes to adding a reference to another worksheet, switch to that sheet and select a cell or a range of cells you want to refer to. This can help you more for reference