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

I added more code for the addin, but still not working. Shortcut key
does not get assigned.

Here is what I have done so far. Thanks for help.

''''''A file named "GoBack.xla"
''''''In Class Modules::EventClass

Public WithEvents App As Application

''''''I put the following section in ThisWorkbook(using workbook
event), it doesn't work
Private Sub App_WorkbookAddinInstall(ByVal Wb As Workbook)
Application.MacroOptions Macro:="ReturnToLastSheet",
HasShortcutKey:=True, ShortcutKey:="Q"
End Sub

Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
OldSheetName = ActiveSheet.Name
End Sub

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

'''''in ThisWorkbook

Dim AppClass As EventClass

Private Sub Workbook_Open()
Set AppClass = New EventClass
Set AppClass.App = Application
End Sub

'in ReturnToLastSheet

'might be wrong but it hasn't come to this far
Sub ReturnToLastSheet()
Worksheets(OldSheetName).Activate
End Sub

 
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 06:41 AM.

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"