How to determine active sheet

JohnSearcy

Board Regular
Joined
Feb 6, 2006
Messages
101
Hi -

I'm trying to remember, but it has been awhile. I have several sheets in a workbook and a comand button on each sheet that calls up the same userform. The information entered onto this userform needs to be entered onto the open or active sheet a person is in at the time. I can't remember the correct way to do that - what I'm getting at is....If Sheets("sheet1") is active Then..... else if sheets("sheet2") is active Then.....and so on. Hope I explained well.

Appreciate any suggestions,
John
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Your question is not entirely clear, but it sounds like you want to use the ActiveSheet object which holds a reference to which ever worksheet is active. For example...

Code:
MsgBox "The currently active sheet is named """ & ActiveSheet.Name & """."
 
Upvote 0
To VoG: I never thought about that. That would work. I guess I was overthinking it.

To Rick: I was overthinking it and I guess nothing llike what I was thinking exists. Both of your suggestions are what I was looking for.

Thanks to you both!!
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,548
Members
452,927
Latest member
rows and columns

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