PC Review


Reply
Thread Tools Rate Thread

Basic VBA Question

 
 
amirstal
Guest
Posts: n/a
 
      20th Dec 2006
How do I make my macro save my spreadsheet when I run it?

 
Reply With Quote
 
 
 
 
keri
Guest
Posts: n/a
 
      20th Dec 2006
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 With Quote
 
amirstal
Guest
Posts: n/a
 
      20th Dec 2006
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Question Kathleen Microsoft Outlook Discussion 4 1st Jul 2008 05:35 PM
Basic WCF/C# question Jacob Microsoft C# .NET 0 2nd Mar 2008 08:52 PM
C# basic question =?Utf-8?B?U2FkaQ==?= Microsoft C# .NET 3 22nd Oct 2004 10:43 AM
Check box validaion question (basic question) paul Microsoft Access Forms 1 3rd Dec 2003 12:36 AM
basic question Deborah Windows XP New Users 4 3rd Oct 2003 07:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:24 AM.