View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Damil4real Damil4real is offline
external usenet poster
 
Posts: 34
Default PLEASE HELP!!! PLEASE!!!

On Sep 3, 8:47*am, "ruic" wrote:
This should save the workbook to your path with the name that you want:

NewFile = "C:\YOUR PATH HERE\" & "Monthly Expenses " & Range(A1:A1) & "..xls"
WorkBook.SaveAs NewFile
WorkBook.Close False

Range(A1:A1) should be changed to the place where your date is. You may also
have to change the Cell value to a string by using DateToStr or something
similar.

--
Rui

"Damil4real" wrote in message

...



How can I get macro to save a workbook to a specific path? And then I
want it to reference a cell in the workbook as part of its file name
when it's saved.


Example:


Save workbook as "Monthly Expenses 1-Sept-08"


The "Monthly Expenses" word is constant, but the date will change
daily.
I want this workbook to be save to in a specific folder in C:\....)
Also a pop-up window should come up asking if user want to overwrite
an already saved file.
If they say yes, then file should be overwritten, and a pop-up window
saying "file saved!" If they say no, then file should not be saved at
all, and a pop-up window saying "file not saved!


Can you please help me ASAP????


THANKS A BUNCH!- Hide quoted text -


- Show quoted text -


Thanks for responding to my request! I'm totally new to VBA and macro,
so while what you posted might sound simple to a lot of people, I
might find it still kinda difficult to understand.

So how do I actually paste the code in the Microsoft Visual Basic?

I pasted your code directly into it, but it didn't recognize it all.
How am I supposed to post the code?

Is it like this?

Sub saveas()

NewFile = "C:\YOUR PATH HERE\" & "Monthly Expenses " & Range(A1:A1) &
".xls"
Workbook.saveas NewFile
Workbook.Close False

End Sub

Posting it like that is now working.

I appreciate any assistance.

Thanks!