LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Help on Add-in for switching between sheets

I wrote a macro to switch between 2 sheets, works well for my file.

I'd like to use it for any workbook and distribute it in the office. I
saved the code below as an addin and copy it to ...\Library, then chose
it on Tools\Add-ins, but nothing happens, can't find it anywhere.

I'd like to assign the macro to a shortcut or a button (ideally
ctrl+tab) so I can use it. Thanks.

'in Module1
Public OldSheetName As String

Sub ReturnToLastSheet()
Worksheets(OldSheetName).Activate
End Sub

'in ThisWorkbook
Private Sub Workbook_Open()
OldSheetName = ActiveSheet.Name
End Sub

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
OldSheetName = Sh.Name
End Sub

***

Furthermore, if people like it, I may want to make it intall and assign
shortcut automatically, but have no idea how to do that yet, any hints?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
shortcut key for switching sheets wb198 Excel Discussion (Misc queries) 2 February 1st 08 05:34 PM
switching between sheets using the keyboard amirasherif Excel Discussion (Misc queries) 3 January 15th 08 03:14 PM
Controlling switching to other sheets Gordon Smith \(eMVP\) Excel Programming 5 June 15th 06 07:06 AM
Switching between sheets in same window... Kojones Excel Discussion (Misc queries) 1 July 16th 05 10:16 PM
Switching Sheets RogeR Excel Programming 1 June 10th 04 02:36 AM


All times are GMT +1. The time now is 02:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"