Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to add a keyboard shortcut for a function I have. I have the
following code in the "ThisWorkbook" 'module': Option Explicit Const DATECOL As String = "B" Public Sub FindToday() ' Keyboard Shortcut: Ctrl+T Dim r As Range On Error Resume Next Set r = ThisWorkbook.Worksheets(1).Range(DATECOL & ":" & DATECOL).Find(what:=Date, LookIn:=xlValues) If Not r Is Nothing Then r.Select End If ThisWorkbook.Sheets(1).Activate End Sub Public Sub Workbook_Open() Application.MacroOptions Macro:="FindToday", HasShortcutKey:=True, ShortcutKey:="t" FindToday End Sub I get: Run-time error "1004": Method 'MacroOptions' of object '_Application' failed << I've tried all sorts of things (making the routines public, trying Macro:=ThisWorkbook.Name & "!" & "FindToday", trying it without assigning the shortcut key - all fail. Any suggestions, please?! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Method 'MacroOptions' of object'_Application' failed Runtime Error 1004 | Excel Discussion (Misc queries) | |||
Trouble With MacroOptions | Excel Programming | |||
MacroOptions Method | Excel Programming | |||
MacroOptions doesn't stick | Excel Programming | |||
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? | Excel Programming |