LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default E-Mail as Hyperlink

One way is to use the date and time

Format(Now, "dd-mm-yy h-mm-ss")



--
Regards Ron De Bruin
http://www.rondebruin.nl



"BN-CD" wrote in message
...

Thanks for pointing me in the right direction.:) I was able to get it
working right, finally.

One more question, If I may.

I have the macro automatically saving the workbook then e-mailing the
form to a distribution list. The file name that the workbook is saved
under comes from a job and lot number along with the current date all
pulled from sheet1 in workbook. The problem is: there will be cases
where this information will be the same so when the macro tries to save
the workbook it tells you there is already a file names "xx".xls, do you
want to overwrite it. We obviously don't want to overwrite it since we
are making a new form. I'm woundering if there is a way to write the
code so IF there is already a file with the same name in that directory
add an "a" or whatever at the end of the file name. Would this be as
simple as adding an IF statement to the save part of the code? If it is
I don't have a clue how to check to see if the file name already
exists.

If it will help here is the code I have to save the document:


Code:
--------------------
Dim sDept As String
Dim sDate As String
Dim sJob As String
Dim sLot As String
Dim fileloc As String
Dim sShift As String

sDept = Format(ActiveSheet.Range("B3").Value)
sDate = Format(Date, "yymmdd")
sJob = Format(ActiveSheet.Range("A6").Value)
sLot = Format(ActiveSheet.Range("B6").Value)
sShift = Format(ActiveSheet.Range("E6").Value)

fileloc = "G:\GENERAL\Scrap_Investigation\" & sDept & "\" & sJob & "_" & sLot & "_" & sDate

ActiveWorkbook.SaveAs Filename:=fileloc

MsgBox "New file created at: " & fileloc, vbInformation, "File Complete"
--------------------

I'm "learning as I go" here so any help is appriciated.


--
BN-CD
------------------------------------------------------------------------
BN-CD's Profile: http://www.excelforum.com/member.php...o&userid=35374
View this thread: http://www.excelforum.com/showthread...hreadid=551489



 
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
Some E-mail Addresses Won't Let Me Hyperlink Gretchen Excel Discussion (Misc queries) 0 September 2nd 09 02:58 AM
E-mail Excel workbook as hyperlink Mike Milmoe Excel Discussion (Misc queries) 0 April 10th 08 05:08 PM
Removing Mail to: hyperlink option ABI Excel Discussion (Misc queries) 1 June 4th 07 12:34 PM
I cannot remove a hyperlink (mail to) in a cell ScarlotteMCM Excel Worksheet Functions 2 October 11th 06 05:39 PM
Macro to e-mail hyperlink Ian[_8_] Excel Programming 0 July 30th 03 11:14 AM


All times are GMT +1. The time now is 03:53 AM.

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"