Hello Group,
I use the following code to save file as an html at the end of month
with Date stamp.
Sub chem_gas_7day()
Dim newSecond
Dim fname As String
fname = Format(Date, quot;yyyy-mmquot;)Sheets(quot;dataquot;).Select
If CDate(Format(Range(quot;A2quot;).Value, quot;mm/dd/yyyyquot;)) =
CDate(DateSerial(Year(Now), Month(Now) 1, 0)) ThenActiveWorkbook.Save
ChDir quot;C:\TEST\quot;
ActiveWorkbook.SaveAs Filename:=quot;C:\TEST\quot; amp; fname amp; quot;_Reportquot;
amp; quot;.htmlquot;, FileFormat:=xlHtml, _
ReadOnlyRecommended:=False, CreateBackup:=FalseElse
Sheets(quot;Reportquot;).Select
Range(quot;A1quot;).Select
ActiveWorkbook.Save
ChDir quot;C:\TEST\quot;
ActiveWorkbook.SaveAs Filename:=quot;C:\TEST\Report.htmlquot;,
FileFormat:=xlHtml, _
ReadOnlyRecommended:=False, CreateBackup:=False
End If
End SubI wonder if i can save file now every Wednesday with Date stamp (file
name = wednesday date). In other words saving file every 7th day.
Thanks in adavnce for help.
Sam--
sam76210
------------------------------------------------------------------------
sam76210's Profile: www.excelforum.com/member.php...oamp;userid=20885
View this thread: www.excelforum.com/showthread...hreadid=520145
- Apr 21 Sat 2007 20:37
Save Excel File every wednesday VB Script Help !!
close
全站熱搜
留言列表
發表留言