Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to Save worksheet to new document

Hi all,

I need create a macro that will:
- copy a Tab from one workbook into a new workbook
- Save to a specific path to a shared server, with a unique name (dept)

What I've done:
I can get the macro to copy to a new workbook, and the path to the right
server, but I don't know how to input the unique name (dept).

Other info:
- The unique name (dept) is available in the document (from a drop down box
the user selects), but I can't figure out how to copy it into the "save"
function in the macro. I've tried the control keys, but that didn't work.
- Could I have the user type it in (use a sub-macro or some kind of input
form?)

Any help would be appreciated.
Linda
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro to Save worksheet to new document

Hi Linda

Try this

It use the value of A1

..SaveAs "\\Judith\Ron\ " & wb.Sheets(1).Range("A1").Value & ".xls"


Sub Copy_ActiveSheet()
Dim wb As Workbook
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "\\Judith\Ron\ " & wb.Sheets(1).Range("A1").Value & ".xls"
.Close False
End With
Application.ScreenUpdating = True
End Sub



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



"Linda@LLBean" wrote in message ...
Hi all,

I need create a macro that will:
- copy a Tab from one workbook into a new workbook
- Save to a specific path to a shared server, with a unique name (dept)

What I've done:
I can get the macro to copy to a new workbook, and the path to the right
server, but I don't know how to input the unique name (dept).

Other info:
- The unique name (dept) is available in the document (from a drop down box
the user selects), but I can't figure out how to copy it into the "save"
function in the macro. I've tried the control keys, but that didn't work.
- Could I have the user type it in (use a sub-macro or some kind of input
form?)

Any help would be appreciated.
Linda



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro to Save worksheet to new document

This worked like a charm!! Thank you Ron!
:-)

....Linda

"Ron de Bruin" wrote:

Hi Linda

Try this

It use the value of A1

..SaveAs "\\Judith\Ron\ " & wb.Sheets(1).Range("A1").Value & ".xls"


Sub Copy_ActiveSheet()
Dim wb As Workbook
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "\\Judith\Ron\ " & wb.Sheets(1).Range("A1").Value & ".xls"
.Close False
End With
Application.ScreenUpdating = True
End Sub



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



"Linda@LLBean" wrote in message ...
Hi all,

I need create a macro that will:
- copy a Tab from one workbook into a new workbook
- Save to a specific path to a shared server, with a unique name (dept)

What I've done:
I can get the macro to copy to a new workbook, and the path to the right
server, but I don't know how to input the unique name (dept).

Other info:
- The unique name (dept) is available in the document (from a drop down box
the user selects), but I can't figure out how to copy it into the "save"
function in the macro. I've tried the control keys, but that didn't work.
- Could I have the user type it in (use a sub-macro or some kind of input
form?)

Any help would be appreciated.
Linda




Reply
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 to automatically save document with cell reference as filena Erich Excel Discussion (Misc queries) 2 November 17th 09 02:47 PM
file size after using macro to save a worksheet BigPig Excel Programming 2 March 10th 06 02:03 AM
'document not saved' for 'save' or 'save as' an EXCEL file Judy Chuang Excel Discussion (Misc queries) 1 July 11th 05 10:12 PM
Macro to save worksheet RSVP Excel Programming 2 April 26th 04 02:41 PM
Macro to save file and print document abxy[_7_] Excel Programming 2 January 14th 04 03:45 AM


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

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"