#1   Report Post  
Posted to microsoft.public.excel.misc
lbargers
 
Posts: n/a
Default Excel Sheets


Hello,

how can I reference the name of the currently selected sheet, in a
macro?

I tried:

me.name

and it only pulls up the name of the first sheet, no matter which sheet
I have selected..

Thanks for any help on this issue..

Larry


--
lbargers
------------------------------------------------------------------------
lbargers's Profile: http://www.excelforum.com/member.php...o&userid=32798
View this thread: http://www.excelforum.com/showthread...hreadid=532978

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Excel Sheets

If the code is under a worksheet, then me.name will give you the name of the
sheet that owns the code.

You may want: Activesheet.name



lbargers wrote:

Hello,

how can I reference the name of the currently selected sheet, in a
macro?

I tried:

me.name

and it only pulls up the name of the first sheet, no matter which sheet
I have selected..

Thanks for any help on this issue..

Larry

--
lbargers
------------------------------------------------------------------------
lbargers's Profile: http://www.excelforum.com/member.php...o&userid=32798
View this thread: http://www.excelforum.com/showthread...hreadid=532978


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
lbargers
 
Posts: n/a
Default Excel Sheets


Hey Dave,

I should of explained myself better, I would like the code in a Module,
this way the user will not have to select between multiple macros. The
user should be able to select any sheet in the workbook and exectue the
macro..

Thanks

Larry


--
lbargers
------------------------------------------------------------------------
lbargers's Profile: http://www.excelforum.com/member.php...o&userid=32798
View this thread: http://www.excelforum.com/showthread...hreadid=532978

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Excel Sheets

Have the user select the correct sheet first.

Then you can write your macro to work against the Activesheet.

With Activesheet
.range("a1").clearcontents
end with

For example.



lbargers wrote:

Hey Dave,

I should of explained myself better, I would like the code in a Module,
this way the user will not have to select between multiple macros. The
user should be able to select any sheet in the workbook and exectue the
macro..

Thanks

Larry

--
lbargers
------------------------------------------------------------------------
lbargers's Profile: http://www.excelforum.com/member.php...o&userid=32798
View this thread: http://www.excelforum.com/showthread...hreadid=532978


--

Dave Peterson
Reply
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
How to save sheets in new excel files, automatically? SuperDuck Excel Worksheet Functions 1 October 22nd 05 09:37 AM
Using Access database to "populate" Excel Sheets maacmaac Excel Discussion (Misc queries) 1 September 19th 05 05:06 PM
Opening multiple Excel files that contain varied selected sheets MLBrownewell Excel Worksheet Functions 0 September 14th 05 05:48 PM
How can I merge multiple sheets from different Excel files workbo. jones021 Excel Worksheet Functions 0 April 20th 05 08:48 PM
Create New Microsoft Excel Worksheet Has 3 Sheets Bassam Setting up and Configuration of Excel 0 February 9th 05 08:51 PM


All times are GMT +1. The time now is 09:20 PM.

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"