#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 88
Default time in subject line

good afternoon,

i have a macro that i want to adjust just a bit. the portion of the macro
is as follows:

fname = Format(Range("E3").Value, "yyyy-mm-dd") & " " & Range("A1").Value
ActiveWorkbook.SaveAs Filename:="C:\Users\Documents\" & fname & ".xlsx",
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

'Sub Email() - sends a copy of the email to the recipients listed in the
Recip Array
Recip = ")

everything works fine, but in the subject line, i would like the time
displayed along with the date. i tried to save the file in the format
yyyy-mm-dd hh:mm but filenames do not allow ":" . next i tried to assigne a
secondary name subj = format (range("E3").value, "yyyy-mm-dd hh:mm") and i
added that just below the recip = array... in the macro, but that does not
show the time either.

any other suggestions?

jat

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,510
Default time in subject line

If you want the time included in the filename, the easy way is to just leave
the colon out of the format:-

fname = Format(Range("E3").Value, "yyyy-mm-dd hhmm")

It will just show as 24hour (military time)


--
Regards,

OssieMac


"jatman" wrote:

good afternoon,

i have a macro that i want to adjust just a bit. the portion of the macro
is as follows:

fname = Format(Range("E3").Value, "yyyy-mm-dd") & " " & Range("A1").Value
ActiveWorkbook.SaveAs Filename:="C:\Users\Documents\" & fname & ".xlsx",
FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False

'Sub Email() - sends a copy of the email to the recipients listed in the
Recip Array
Recip = ")

everything works fine, but in the subject line, i would like the time
displayed along with the date. i tried to save the file in the format
yyyy-mm-dd hh:mm but filenames do not allow ":" . next i tried to assigne a
secondary name subj = format (range("E3").value, "yyyy-mm-dd hh:mm") and i
added that just below the recip = array... in the macro, but that does not
show the time either.

any other suggestions?

jat

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
email hyperlink - cell value in subject line boustrophedon Excel Discussion (Misc queries) 19 April 21st 23 06:12 PM
hyperlink with cell info in subject line [email protected] Excel Discussion (Misc queries) 0 January 2nd 08 05:26 PM
Variables in the subject line of an e-mail hyperlink midol559 Excel Discussion (Misc queries) 0 September 8th 06 04:30 PM
Customize Subject Line terezakat Excel Discussion (Misc queries) 0 July 25th 05 10:47 PM
Populate the subject line. Scott Hutchinson Excel Worksheet Functions 1 February 18th 05 08:20 PM


All times are GMT +1. The time now is 04:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"