Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Date Formats | Excel Discussion (Misc queries) | |||
Help with Date formats | Excel Discussion (Misc queries) | |||
Picking a Date to Populate a Cell | Excel Discussion (Misc queries) | |||
Date formula not picking up 1st of the month (weekday) | Excel Discussion (Misc queries) | |||
picking out date ranges | Excel Worksheet Functions |