View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default open new workbook

how about something like this:

Sub test2()
Dim wb1 As Workbook
Dim shts As Long
Dim fpath As String

fpath = ActiveWorkbook.Path & "\"
With Application
shts = .SheetsInNewWorkbook
.SheetsInNewWorkbook = 1
Workbooks.Add
.SheetsInNewWorkbook = shts
End With
ActiveWorkbook.SaveAs Filename:=fpath & "test.xls"
End Sub

--


Gary


"John" wrote in message
...
How do I open and name a new workbook with only 1 worksheet in vb? I tried
learning how using record macro but couldn't get things to work.

thanks

John