Macro keyboard shortcut doesn't work

Yamezz

Active Member
Joined
Nov 22, 2006
Messages
346
Office Version
  1. 2019
I have a couple of macros in my PERSONAL.XLSB file. Both are assigned a keyboard shortcut, but only one works with the shortcut. It worked briefly, but not anymore.
This works:
VBA Code:
Sub ShowAllCTRLEND()
'
' Keyboard Shortcut: Ctrl+q
'
    If ActiveSheet.FilterMode = True Then
    
    ActiveSheet.AutoFilter.ShowAllData
    Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Select
    Cells(ActiveCell.Row, 1).Select
    ActiveCell.Offset(1, 3).Activate
    
    Else
    Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Select
    Cells(ActiveCell.Row, 1).Select
    ActiveCell.Offset(1, 3).Activate
    End If

End Sub

This code will run fine if evoked manually, but will not run with the shortcut, despite being listed as a shortcut in the 'options' of the macro menu.
VBA Code:
Sub AlignRight()
'
' AlignRight Macro
'
' Keyboard Shortcut: Ctrl+Shift+R
'
    With Selection
        .HorizontalAlignment = xlRight
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
End Sub

What could be the cause?
 
Method 1 did not work.
... then cut and pasted my handful of little macros all into the "Custom" module and reassigned the keyboard shortcuts.

You probably used method 1 without realizing it.
After all, the cutting and pasting was a prerequisite I mentioned:
To begin with, move your macro (cut & paste) forth and back between different modules in your PERSONAL.XLSB workbook.

Anyway, glad it's resolved and thanks for posting back (y)
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,216,075
Messages
6,128,665
Members
449,462
Latest member
Chislobog

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