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
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
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
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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks