ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving file with date variable (https://www.excelbanter.com/excel-programming/370533-saving-file-date-variable.html)

Steel Monkey[_16_]

Saving file with date variable
 

Hi All

Hopefully just a quick question :

I am trying to save a file as a .csv. See below code:

Code:
--------------------
fileSaveName = Application.GetSaveAsFilename("C:\Documents and Settings\My Documents\Testing\excel\" & empinput, fileFilter:="CSV Files (*.csv), *.csv")
--------------------


empinput is a variable which works fine, at the end of the filename
though i need the current month inserted in mm format

i.e. 22208 'if empinput = 222
can anyone help me with this ??

Thanks in advance!!


--
Steel Monkey
------------------------------------------------------------------------
Steel Monkey's Profile: http://www.excelforum.com/member.php...o&userid=29051
View this thread: http://www.excelforum.com/showthread...hreadid=572173


Steel Monkey[_17_]

Saving file with date variable
 

Problem solved. In case any one is wondering here i got the current
month as something i could use.


Code:
--------------------
Dim mystr
mystr = Format(Date, "mm")
--------------------


then just used this:

Code:
--------------------
fileSaveName = Application.GetSaveAsFilename("C:\Documents and Settings\My Documents\Testing\excel\" & empinput & mystr, fileFilter:="CSV Files (*.csv), *.csv")
--------------------


Steel Monkey


--
Steel Monkey
------------------------------------------------------------------------
Steel Monkey's Profile: http://www.excelforum.com/member.php...o&userid=29051
View this thread: http://www.excelforum.com/showthread...hreadid=572173



All times are GMT +1. The time now is 12:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com