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.
thx u!
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!