Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Convert worksheet string name to date format in cell

Hello-

I have a workbook that will always have a sheet name such as 082509. I
want to have cell J2 take that string and convert to a MM/DD/YY
format. I tried the following, but it did not work:

Range("J2").Select
ActiveCell.FormulaR1C1 = DateValue(Format(Range(Worksheet
(1)).Value, "00/00/00"))

Any ideas?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Convert worksheet string name to date format in cell

maybe...

I'd use:

With ActiveSheet.Range("J2")
.NumberFormat = "mm/dd/yy" 'whatever you want
.Value = DateValue(Format(Worksheets(1).Name, "00/00/00"))
End With



Sabosis wrote:

Hello-

I have a workbook that will always have a sheet name such as 082509. I
want to have cell J2 take that string and convert to a MM/DD/YY
format. I tried the following, but it did not work:

Range("J2").Select
ActiveCell.FormulaR1C1 = DateValue(Format(Range(Worksheet
(1)).Value, "00/00/00"))

Any ideas?

Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Convert worksheet string name to date format in cell

On Sep 3, 6:57*pm, Dave Peterson wrote:
maybe...

I'd use:

With ActiveSheet.Range("J2")
* * .NumberFormat = "mm/dd/yy" 'whatever you want
* * .Value = DateValue(Format(Worksheets(1).Name, "00/00/00"))
End With

Sabosis wrote:

Hello-


I have a workbook that will always have a sheet name such as 082509. I
want to have cell J2 take that string and convert to a MM/DD/YY
format. I tried the following, but it did not work:


Range("J2").Select
* * ActiveCell.FormulaR1C1 = DateValue(Format(Range(Worksheet
(1)).Value, "00/00/00"))


Any ideas?


Thanks


--

Dave Peterson


Dave, thanks for the help!
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
How to convert string to date phil Excel Worksheet Functions 2 October 2nd 06 06:01 PM
How I convert date formatt of dd/mm/yy to mm/yy (not cell format) Gilad Yron Excel Discussion (Misc queries) 1 March 15th 06 08:32 AM
Convert Date to STring tonymaguire Excel Discussion (Misc queries) 9 February 15th 06 11:33 AM
Excel 2000 worksheet where I want to convert date format Russell-stanely Excel Discussion (Misc queries) 5 December 19th 05 02:02 AM
Can i convert numbers into string format? talia_k Excel Discussion (Misc queries) 3 April 28th 05 03:27 PM


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