A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Save single worksheet as new workbook



 
 
Thread Tools Display Modes
  #1  
Old July 28th, 2004, 05:20 PM
GorillaBoze
external usenet poster
 
Posts: n/a
Default Save single worksheet as new workbook

I have a workbook containing multiple worksheets. I would like a macro
that would save a single worksheet as a new file. Also, can I have the
new file be saved as the data in a certain cell?

I have a macro that will save the worksheet to a new workbook, but it
saves it with the same filename each time.

Please help!

Thanks
-GorillaBoze


---
Message posted from http://www.ExcelForum.com/

  #2  
Old July 28th, 2004, 05:50 PM
Ron de Bruin
external usenet poster
 
Posts: n/a
Default Save single worksheet as new workbook

Hi GorillaBoze

One way is to use a date time stamp in the file name
Example that save the activesheet in C:\

Or look in the VBA help for Application.GetSaveAsFilename

Sub CopySave_ActiveSheet()
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "C:\Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.Close False
End With
Application.ScreenUpdating = True
End Sub

For a cell value use
..SaveAs Sheets("mysheet").Range("d1").Value



--
Regards Ron de Bruin
http://www.rondebruin.nl


"GorillaBoze " wrote in message ...
I have a workbook containing multiple worksheets. I would like a macro
that would save a single worksheet as a new file. Also, can I have the
new file be saved as the data in a certain cell?

I have a macro that will save the worksheet to a new workbook, but it
saves it with the same filename each time.

Please help!

Thanks
-GorillaBoze


---
Message posted from http://www.ExcelForum.com/



  #3  
Old July 28th, 2004, 06:33 PM
GorillaBoze
external usenet poster
 
Posts: n/a
Default Save single worksheet as new workbook

I am having problems when I try to use a cell value. I am trying to
use:

.SaveAs "Z:\SecDept\ Sheets("Tax40").Range("A10").Value
& " " & strdate & ".xls"

Is this correct?


---
Message posted from http://www.ExcelForum.com/

  #4  
Old July 28th, 2004, 07:41 PM
jeff
external usenet poster
 
Posts: n/a
Default Save single worksheet as new workbook

Hi,

Not quite:

Try:
..SaveAs "Z:\SecDept\" & Sheets("Tax40").Range
("A10").Value & " " & strdate & ".xls"


jeff

-----Original Message-----
I am having problems when I try to use a cell value. I

am trying to
use:

.SaveAs "Z:\SecDept\ Sheets("Tax40").Range("A10").Value
& " " & strdate & ".xls"

Is this correct?


---
Message posted from http://www.ExcelForum.com/

.

  #5  
Old July 28th, 2004, 08:18 PM
GorillaBoze
external usenet poster
 
Posts: n/a
Default Save single worksheet as new workbook

That works! Thanks Jeff

I have a question though...why does it not work when I add another
folder to the location?

.saveas "Z:\SecDept\Recommendations" & Sheets("Tax40").Range
("A10").Value & " " & strdate & ".xls"


---
Message posted from http://www.ExcelForum.com/

  #6  
Old July 28th, 2004, 08:22 PM
Ron de Bruin
external usenet poster
 
Posts: n/a
Default Save single worksheet as new workbook

Use this

.SaveAs "Z:\SecDept\" & Sheets("Tax40").Range("A10").Value _
& " " & strdate & ".xls"


--
Regards Ron de Bruin
http://www.rondebruin.nl


"GorillaBoze " wrote in message ...
I am having problems when I try to use a cell value. I am trying to
use:

SaveAs "Z:\SecDept\ Sheets("Tax40").Range("A10").Value
& " " & strdate & ".xls"

Is this correct?


---
Message posted from http://www.ExcelForum.com/



  #7  
Old July 28th, 2004, 08:24 PM
Ron de Bruin
external usenet poster
 
Posts: n/a
Default Save single worksheet as new workbook

saveas "Z:\SecDept\Recommendations\" & Sheets("Tax40").Range("A10").Value & " " & strdate & ".xls"

You forgot a \ after the folder name

--
Regards Ron de Bruin
http://www.rondebruin.nl


"GorillaBoze " wrote in message ...
That works! Thanks Jeff

I have a question though...why does it not work when I add another
folder to the location?

saveas "Z:\SecDept\Recommendations" & Sheets("Tax40").Range
("A10").Value & " " & strdate & ".xls"


---
Message posted from http://www.ExcelForum.com/



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open workbook at specific worksheet Adam Price General Discussion 1 June 19th, 2004 01:31 AM
emailing single worksheet Ken G. General Discussion 3 June 18th, 2004 12:19 PM
enter data in single worksheet, appear in multiple munscher Worksheet Functions 5 June 11th, 2004 04:18 PM
Making a workbook always open on the same worksheet? Frank Kabel Worksheet Functions 2 April 21st, 2004 03:29 PM
Emailing a Single Worksheet fiset Worksheet Functions 0 February 23rd, 2004 06:42 PM


All times are GMT +1. The time now is 08:57 AM.


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