Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I refer a macro on a new sheet i just created?
Hi
i have a set of data, which i will create a pivot table, and the pivot table will be shown on a random new sheet number. I am going to create a macro to refer the activesheet as the new sheet i have just created. how do i do it? activesheet.next? it doesnt work .... please help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I refer a macro on a new sheet i just created?
when you do
worksheets.Add the sheet just created is the activesheet. If you will be changing another sheet to the activesheet, just set a reference to this new sheet Dim shNew as Worksheet Dim shOld as Worksheet set shOld = Activesheet worksheets.Add set shNew = Activesheet Now shOld hold a referene to the original activesheet and shNew a reference to the newly added sheet. (as an example) -- Regards, Tom Ogilvy "Joe" wrote: Hi i have a set of data, which i will create a pivot table, and the pivot table will be shown on a random new sheet number. I am going to create a macro to refer the activesheet as the new sheet i have just created. how do i do it? activesheet.next? it doesnt work .... please help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
copied formulas refer to destination sheet not source sheet | Excel Worksheet Functions | |||
How can I refer to sheet number not sheet (name)? | Excel Worksheet Functions | |||
Refer to a hidden sheet using a macro. | Excel Programming | |||
Refer new sheet to previous sheet | Excel Worksheet Functions | |||
Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X | Excel Programming |