LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Refer to the worksheet containing the current running code

Hi

I think this should be simple, but I can't find a way to do this.

I am calling code from a Command Button which in turn calls code in a
Module. The code in the Module does some recurring copy and paste
operations to a chosen sheet. I need to pass the name of the sheet
where the command button resides to the sub in the Module. How do I do
this?

Currently, I have a private wrapper sitting in the button sheet. I
have tried guesses like Worksheet.Name - but that gives an error.
ActiveSheet might work - but I am not sure how to go about this.

The perfect solution would be to have the wrapper refer to the sheet
that the code (rather than the button) resides in, so I can call the
routine via other means than a button. In paraphrasing, object code
like the following would be perfect:

ThisPrivateSub.RelatedSheetObject.Name

Does anyone know how to do this?

Thanks for any help

John

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refer to current row in formula willemeulen[_12_] Excel Worksheet Functions 5 May 19th 09 03:34 PM
how to prevent code running when in a worksheet code Corey Excel Programming 5 August 13th 06 08:52 AM
how to I refer to current workbook without using its name? confused Excel Worksheet Functions 2 June 16th 05 11:50 PM
Refer to Worksheet Ranges in Code Andibevan[_2_] Excel Programming 8 March 30th 05 12:20 PM
More then 1 Excel object running at same time , how can I refer to right one in code? Dave Lauberts Excel Programming 5 October 28th 04 03:57 PM


All times are GMT +1. The time now is 09:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"