ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Which Worksheet is Active? (https://www.excelbanter.com/excel-programming/432077-worksheet-active.html)

Bishop

Which Worksheet is Active?
 
If I'm working in VBE and I need to know what the active Workbook is or which
Worksheet is active, how do I figure that out? Is there some tool that will
tell me this?

ker_01

Which Worksheet is Active?
 
msgbox activeworkbook.name
msgbox activesheet.name
(or, activeworkbook.activesheet.name)

HTH,
Keith

"Bishop" wrote:

If I'm working in VBE and I need to know what the active Workbook is or which
Worksheet is active, how do I figure that out? Is there some tool that will
tell me this?


FSt1

Which Worksheet is Active?
 
hi
Sub whatisit()
Dim awbn As String
Dim awsn As String
awbn = ActiveWorkbook.Name
awsn = ActiveSheet.Name
MsgBox awbn
MsgBox awsn
End Sub

regards
FSt1

"Bishop" wrote:

If I'm working in VBE and I need to know what the active Workbook is or which
Worksheet is active, how do I figure that out? Is there some tool that will
tell me this?


Bishop

Which Worksheet is Active?
 
This is perfect. How do I add a shortcut key to this? Say I wanted to use
ctrl+q to run this?

"FSt1" wrote:

hi
Sub whatisit()
Dim awbn As String
Dim awsn As String
awbn = ActiveWorkbook.Name
awsn = ActiveSheet.Name
MsgBox awbn
MsgBox awsn
End Sub

regards
FSt1

"Bishop" wrote:

If I'm working in VBE and I need to know what the active Workbook is or which
Worksheet is active, how do I figure that out? Is there some tool that will
tell me this?


FSt1

Which Worksheet is Active?
 
hi
install the macro in a standard module then on the menu bar....
Toolsmacromacros
highlight the macro then click the options button. add your shortcut then ok
out.

Regards
FSt1

"Bishop" wrote:

This is perfect. How do I add a shortcut key to this? Say I wanted to use
ctrl+q to run this?

"FSt1" wrote:

hi
Sub whatisit()
Dim awbn As String
Dim awsn As String
awbn = ActiveWorkbook.Name
awsn = ActiveSheet.Name
MsgBox awbn
MsgBox awsn
End Sub

regards
FSt1

"Bishop" wrote:

If I'm working in VBE and I need to know what the active Workbook is or which
Worksheet is active, how do I figure that out? Is there some tool that will
tell me this?



All times are GMT +1. The time now is 12:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com