ActiveSheet Name

Nomis_Eswod

Board Regular
Joined
Jul 27, 2005
Messages
153
Hi,

As part of a macro I want a message box that just says the name of the Active Sheet. This macro could be run on any 1 of a number of sheets so the name changes.

I just can't work out how to get the name!

Any ideas?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Try this.
Code:
Msgbox ActiveSheet.Name
Or am I missing something?
 
Upvote 0
Well that's what I thought....but I've tried it and nothing happens! It's in a module of it's own with nothing else so can't understand why it's not working??
 
Upvote 0
No message is showing...but it's wierd. I just did a simple MsgBox "Test" to see if that worked and no message box showed with that either!
 
Upvote 0
Have you turned anything off? Say ScreenUpdating, events?
 
Upvote 0
I don't think so, well, not without turning them back on again!

I've just added :
Application.ScreenUpdating = True
Application.DisplayAlerts = True

Before the MsgBox "Test" and it still doesn't work!!
 
Upvote 0
I've got tonnes of code, too much to post it all up here! I've just gone through and found a couple of instances where I'd set ScreenUpdating to False twice and True only once with one macro. Could this affect it, if so, how do I get it back to standard??
 
Upvote 0
Right, I've updated the issues I had as described in my previous post and closed and re-opened and it seems to be working now! Even got the answer from my original post to work!

Thanks for your help!
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,024
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top