Macro shortcut keys not work properly

G

Guest

I added to my macro a shortcut key & for some reason it oprate only part of my macro. If anyone familiar with this kind of problem, I would like a solution

This is my macro


' Ctrl+Shift+T shortcu

Sub FindSheets(
Dim FName As Strin
Dim WB As Workboo
Const FOLDER_NAME = "C:\Temp" '<<--CHANG

ChDrive FOLDER_NAM
ChDir FOLDER_NAM
FName = Dir("*.xls"
Workbooks.Add ' New W
Application.DisplayAlerts = False ' Disable delete alert
Sheets("Sheet3").Select 'Delete sheet #3 in new W
ActiveWindow.SelectedSheets.Delet
Sheets("Sheet2").Select 'Delete sheet #2 in new W
ActiveWindow.SelectedSheets.Delet
Application.DisplayAlerts = True ' Enable delete alert
ChDir "C:\Documents and Settings\mlunker\Desktop" ' Save new W
ActiveWorkbook.SaveAs Filename:=
"C:\Documents and Settings\mlunker\Desktop\TempName.xls", FileFormat:=
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False
, CreateBackup:=Fals
Application.DisplayAlerts = Tru
Do Until FName = "" ' copy sheet
Set WB = Workbooks.Open(Filename:=FName
ActiveSheet.Selec
n = Workbooks("TempName.xls").Sheets.Coun
ActiveSheet.Copy After:=Workbooks("TempName.xls").Sheets(n
WB.Close SaveChanges:=Tru
FName = Dir(
Loo
Windows("TempName.xls").Activat
Application.DisplayAlerts = False ' Disable delete alert
Sheets("Sheet1").Select 'Delete sheet #2 in new W
ActiveWindow.SelectedSheets.Delet
Application.CutCopyMode = Fals
ActiveWorkbook.Sav
Application.DisplayAlerts = True ' Enable delete alert
End Su

Thanks
Mata
 
T

Tom Ogilvy

Try changing the shortcut key combination so it doesn't include a Shift.

--
Regards,
Tom Ogilvy


Matan said:
I added to my macro a shortcut key & for some reason it oprate only part
of my macro. If anyone familiar with this kind of problem, I would like a
solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top