Renaming file with imbedded formula with VB

Joined
Aug 14, 2011
Messages
7
Hello everyone -

Longtime lurker, first time poster. I'm fairly new to VB and have reached a point where I've exhausted my abilities.

I'm trying to automate a few processes for work and have been successful in doing so... other than the fact that the file name portion of the exercise is not automated.

Here's a quick excerpt from the code I have thus far:

"C:\Documents and Settings\randomname\Desktop\spreadsheet_20110814_2.csv"

I need this to say the same thing but rather than 20110814 - I want to insert the Today() function. That way it saves as the current date every time i run the macro.

I've searched and searched and cannot come up with how to name a file with an embedded formula. Any suggestions? Thanks!

CharlotteFI
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Code:
filePath = "C:\Documents and Settings\randomname\Desktop\spreadsheet_" & Format(Date, "yyyymmdd") & ".csv"
 
Upvote 0
You're welcome.
BTW - Glad you finally poked your head in...
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top