New file

  • Thread starter Thread starter Ian Coates
  • Start date Start date
I

Ian Coates

According to Excel, the shortcut to a new file is Ctrl-N. If I use the menu,
I am directed to my templates. If I use the shotcut, a new blank workbook is
opened. Is it possible to make Ctrl-N open the templates dialog?
 
Here is a macro (don't remember where I got it) to make a list of files from
which you could use a double click event to open the file from the typed
list.

Sub FindandListFiles()'chg file location to suit.
Application.ScreenUpdating = False
Columns(1).ClearContents
'ThisRow = 2
'Cells(ThisRow, 1).Select
Dim FN As String ' For File Name
Dim ThisRow As Long
Dim FileLocation As String
FileLocation = "c:\whereyourtemplatesare\*.xls"
FN = Dir(FileLocation)
Do Until FN = ""
ThisRow = ThisRow + 1
Cells(ThisRow, 1) = FN
FN = Dir
Loop
Application.ScreenUpdating = True
End Sub

'this is the double click event in the sheet module
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell.Value = "" Then Exit Sub
workbookname = ActiveCell.Value
On Error GoTo OpenWorkbook
Windows(workbookname).Activate
Exit Sub
OpenWorkbook:
Workbooks.Open(workbookname).RunAutoMacros xlAutoOpen
End Sub
 
Back
Top