View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
chijanzen chijanzen is offline
external usenet poster
 
Posts: 139
Default saving a sheet in a new workbook

steve:

try it,

Sub test()
rpath = "P:\Projects\Jobs\"
rname = Split(ThisWorkbook.Name, ".")
fpath = rpath & rname(0)
fname = fpath & "\" & Date & ".xls"
If Dir(fpath, vbDirectory) = "" Then
MkDir fpath
End If
Set wbk = Workbooks.Add
ThisWorkbook.Worksheets("Sheet1").Copy _
After:=wbk.Worksheets("Sheet1")
wbk.SaveAs fname
End Sub

--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"steve" wrote:

Using a button:

1) copy a sheet into a new workbook
2) save the workbook into the following directory:

"P:\Projects\Jobs\....

the next folder will be the same name as the original workbook

is this possible?

i also want to name the new workbook with today's date.

i appreciate any help

thanks,
steve