LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Save as saves selected worksheet instead of whole workbook

Hi -

I have a macro that does a save as action and saves as a name from the
values of a couple cells... and it seems to work okay. The problem is I
have 3 worksheets and it only saves the active worksheet... can anybody
help me out. It would be much appreciated.

This is what I've got

Sub SaveAs()

Dim uname

With ActiveWorkbook.Worksheets("sheet1")
uname = .Range("B2").Value & " " & _
.Range("B3").Value
End With
ActiveWorkbook.SaveAs ThisWorkbook.Name _
& " " & " " & uname & ".xls"
ActiveWorkbook.Close True
End Sub


Again, I need it to save the entire workbook to a new file and not just
the avctive worksheet.
Thanks
A

 
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
save as txt saves different tab, why??? shark102 Excel Discussion (Misc queries) 3 October 12th 07 01:44 PM
save search settings having all tabs selected-or entire workbook Kens Excel Worksheet Functions 0 February 28th 07 09:36 PM
Excel workbook is corrupted, workbook automatically saves on start Paul Gooda Excel Discussion (Misc queries) 3 September 28th 06 04:51 PM
Save As CSV saves empty rows Garrett Excel Discussion (Misc queries) 3 February 18th 05 12:18 AM
How can I test when any worksheet within a workbook is selected Peter McNaughton Excel Programming 2 January 29th 04 04:59 AM


All times are GMT +1. The time now is 07:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"