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?
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,047
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,047
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,047
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,047
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!
 

Watch MrExcel Video

Forum statistics

Threads
1,118,083
Messages
5,570,116
Members
412,305
Latest member
Mozz
Top