Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Basic VBA Question

How do I make my macro save my spreadsheet when I run it?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Basic VBA Question

Sub savethesheet()

ActiveWorkbook.SaveAs Filename:="D:\myfiles\Book1.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
End Sub

Use this code. Obviously change the path of where you want to save it
and the name that you wish to save it as. The way I learned to do these
little things was to record a macro while I was doing what I wanted it
to do. Which is what I did here - set a macro recording then saved my
sheet. Then you can see the code it creates.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Basic VBA Question

Thanks.

keri wrote:
Sub savethesheet()

ActiveWorkbook.SaveAs Filename:="D:\myfiles\Book1.xls",
FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
End Sub

Use this code. Obviously change the path of where you want to save it
and the name that you wish to save it as. The way I learned to do these
little things was to record a macro while I was doing what I wanted it
to do. Which is what I did here - set a macro recording then saved my
sheet. Then you can see the code it creates.


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
basic question M121385 New Users to Excel 4 May 6th 08 06:22 PM
Basic question...sorry jen the runner Excel Worksheet Functions 11 September 18th 07 12:12 AM
Basic question plittle Excel Discussion (Misc queries) 1 May 23rd 06 03:49 PM
Basic VBA question... mattsvai[_7_] Excel Programming 8 February 3rd 06 07:53 PM
BASIC VBA QUESTION MASON Excel Programming 1 December 26th 03 05:04 PM


All times are GMT +1. The time now is 02:20 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"