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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
Try this.
Code:
Msgbox ActiveSheet.Name
Or am I missing something?
 

Nomis_Eswod

Board Regular
Joined
Jul 27, 2005
Messages
153
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??
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
How is it not working?
 

Nomis_Eswod

Board Regular
Joined
Jul 27, 2005
Messages
153

ADVERTISEMENT

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!
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
Have you turned anything off? Say ScreenUpdating, events?
 

Nomis_Eswod

Board Regular
Joined
Jul 27, 2005
Messages
153

ADVERTISEMENT

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!!
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,344
Office Version
  1. 365
Platform
  1. Windows
Can you post your code?
 

Nomis_Eswod

Board Regular
Joined
Jul 27, 2005
Messages
153
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??
 

Nomis_Eswod

Board Regular
Joined
Jul 27, 2005
Messages
153
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!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,124
Messages
5,835,544
Members
430,366
Latest member
glastonbury

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
Top