keyboard shortcut link - macro ...help

bluepenink

Well-known Member
Joined
Dec 21, 2010
Messages
585
hello

i have the following macro and i want to use Ctrl+q to call for my macro.

i used the following code but for some reason when i press ctrl+q it doesnt work.

Code:
Sub SaveAsSpecial()
    ' Keyboard Shortcut: Ctrl+q
    Dim Employee As String, rngDistrict As Range
    
    Employee = ActiveWorkbook.Sheets("Sales Executive Quota (2011)").Range("N5").Value
    
    If Employee = "" Then
        MsgBox "'Sales Executive Quota (2011)'!N5 is empty.", vbExclamation, "No SE"
    Else
        Set rngDistrict = Sheets("SE List").Range("C:C").Find(What:=Employee, _
                                                              LookIn:=xlValues, _
                                                              LookAt:=xlWhole, _
                                                              MatchCase:=False)
        If rngDistrict Is Nothing Then
            MsgBox "Cannot match """ & Employee & """ on sheet ""SE List""", _
                    vbExclamation, "No Employee Match"
        Else
            ActiveWorkbook.Saveas Employee & " - Bonus & Commission Calculator (" & rngDistrict.Offset(, 2).Value & _
                                  ") V.1.0 (" & Format(Date, "MMM D, YYYY") & ").xls", xlNormal
            MsgBox ActiveWorkbook.FullName, _
                    vbInformation, "Save Complete"
        End If
    End If
    
End Sub

thx u!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hello,

Have you set this shortcut in the macro options menu?

Alt + F8 to open the macro dialog
Choose Options
There you will be able to specify CTRL + Q

Does that solve the issue?
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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