LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro shortcut keys not work properly

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro will not run with shortcut keys Doug Excel Worksheet Functions 0 December 4th 09 07:41 PM
macros shortcut keys don't work Doug New Users to Excel 0 November 18th 09 03:04 PM
Shortcut key not running macro properly Ted M H Excel Discussion (Misc queries) 5 October 1st 08 11:07 PM
My Word shortcut keys for Windings won't work in Excel Mulberry Excel Discussion (Misc queries) 5 February 20th 08 08:58 PM
macro shortcut keys don't work andr01d Excel Discussion (Misc queries) 1 February 3rd 06 05:40 PM


All times are GMT +1. The time now is 11:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"