Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Picking up Date formats for use in Filenames, Etc.

I need to know how to use dates as information in files using VBA. I know
the dates are returned as a serial number and the time is the fraction of
same. The formatting of the cell shows the date as you request it to be.
When I try to pick up the date in the format shown for use elsewhere I always
get the number and not the format. Can I convert the information to text
somehow? I have tried various methods and none have succeeded yet. How do I
convert the date into the format that is shown in the cell and use it
elsewhere, for example, in a filename?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Picking up Date formats for use in Filenames, Etc.

Pat,

Dim strName as String

strName = ActiveCell.Text ' beware of "/"
or
strName = Format$(ActiveCell.Value,"mmddyyyy")

ActiveWorkbook.SaveAs FileName:="Mush" & strName
'-----------------------

Jim Cone
San Francisco, USA

"PatQuinn52"

wrote in message

I need to know how to use dates as information in files using VBA. I know
the dates are returned as a serial number and the time is the fraction of
same. The formatting of the cell shows the date as you request it to be.
When I try to pick up the date in the format shown for use elsewhere I always
get the number and not the format. Can I convert the information to text
somehow? I have tried various methods and none have succeeded yet. How do I
convert the date into the format that is shown in the cell and use it
elsewhere, for example, in a filename?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Picking up Date formats for use in Filenames, Etc.

Thank You. This worked perfectly. I know not to use the "/" character but
thanks for the warning.

"Jim Cone" wrote:

Pat,

Dim strName as String

strName = ActiveCell.Text ' beware of "/"
or
strName = Format$(ActiveCell.Value,"mmddyyyy")

ActiveWorkbook.SaveAs FileName:="Mush" & strName
'-----------------------

Jim Cone
San Francisco, USA

"PatQuinn52"

wrote in message

I need to know how to use dates as information in files using VBA. I know
the dates are returned as a serial number and the time is the fraction of
same. The formatting of the cell shows the date as you request it to be.
When I try to pick up the date in the format shown for use elsewhere I always
get the number and not the format. Can I convert the information to text
somehow? I have tried various methods and none have succeeded yet. How do I
convert the date into the format that is shown in the cell and use it
elsewhere, for example, in a filename?

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
Date Formats david d Excel Discussion (Misc queries) 2 September 14th 08 12:29 PM
Help with Date formats ROn Stalenberg[_2_] Excel Discussion (Misc queries) 1 September 10th 08 04:57 AM
Picking a Date to Populate a Cell Jim Farren Excel Discussion (Misc queries) 3 March 19th 08 06:19 PM
Date formula not picking up 1st of the month (weekday) Ang Excel Discussion (Misc queries) 3 September 5th 07 01:58 PM
picking out date ranges mlearner Excel Worksheet Functions 2 February 9th 07 06:59 PM


All times are GMT +1. The time now is 06:56 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"