PC Review


Reply
Thread Tools Rate Thread

How do I refer a macro on a new sheet i just created?

 
 
=?Utf-8?B?Sm9l?=
Guest
Posts: n/a
 
      22nd Jul 2007
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 With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      23rd Jul 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copied formulas refer to destination sheet not source sheet Dantron Microsoft Excel Worksheet Functions 2 21st Oct 2009 09:51 PM
Refer to a hidden sheet using a macro. =?Utf-8?B?ZnVsbGVycw==?= Microsoft Excel Programming 4 1st Jul 2008 06:58 AM
Creating a Formula Refer a New Sheet that is created Q Sean Microsoft Excel Programming 0 30th Nov 2007 01:11 PM
How to refer to dynamically created objects? Beffmans Microsoft ASP .NET 3 19th Jul 2005 02:39 AM
Excel VBA (?!)-refer to a cell on Sheet to left of X, based on criteria on Sheet X tempjones Microsoft Excel Programming 2 7th Jun 2004 09:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:22 PM.