Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Help formatting date

Hi,
I have this date and time value (Friday, October 15, 2004 10:35:12) stored
in a cell ("E80"). I need to format it to 10/15/04 and paste it in another
spreadsheet. What is doing right now is changing to today's day.... I just
need the date, ignore the time.

I've tried Format(Date, "mm/dd/yy") and this is the one giving me todays
date...

Help... this formatting date is not making my date ...

--
gaba :)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Help formatting date

Hi Gaba

right mouse click on cell E80
choose format cells
on the number tab choose custom
in the white line top right type

mm/dd/yy
click Ok

Cheers
JulieD

"gaba" wrote in message
...
Hi,
I have this date and time value (Friday, October 15, 2004 10:35:12) stored
in a cell ("E80"). I need to format it to 10/15/04 and paste it in another
spreadsheet. What is doing right now is changing to today's day.... I just
need the date, ignore the time.

I've tried Format(Date, "mm/dd/yy") and this is the one giving me todays
date...

Help... this formatting date is not making my date ...

--
gaba :)



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help formatting date

Presuming you want a VBA solution

With Worksheets("Sheet2").Range("E80")
.Value = Worksheets("Sheet1").Range("A1").Value
. NumberFormat = "mm/dd/yy")
End With

--

HTH

RP

"JulieD" wrote in message
...
Hi Gaba

right mouse click on cell E80
choose format cells
on the number tab choose custom
in the white line top right type

mm/dd/yy
click Ok

Cheers
JulieD

"gaba" wrote in message
...
Hi,
I have this date and time value (Friday, October 15, 2004 10:35:12)

stored
in a cell ("E80"). I need to format it to 10/15/04 and paste it in

another
spreadsheet. What is doing right now is changing to today's day.... I

just
need the date, ignore the time.

I've tried Format(Date, "mm/dd/yy") and this is the one giving me todays
date...

Help... this formatting date is not making my date ...

--
gaba :)





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Help formatting date

Thanks JulieD and Bob for your answers... still not working. I can't believe
something so simple is giving me such a hard time. I think I know what the
problem is. Soon as I take the day part ("Friday,") it works (both solutions)
perfect.
I need to find a way to Left Trim to the first ","

I'll keep trying
:)

"Bob Phillips" wrote:

Presuming you want a VBA solution

With Worksheets("Sheet2").Range("E80")
.Value = Worksheets("Sheet1").Range("A1").Value
. NumberFormat = "mm/dd/yy")
End With

--

HTH

RP

"JulieD" wrote in message
...
Hi Gaba

right mouse click on cell E80
choose format cells
on the number tab choose custom
in the white line top right type

mm/dd/yy
click Ok

Cheers
JulieD

"gaba" wrote in message
...
Hi,
I have this date and time value (Friday, October 15, 2004 10:35:12)

stored
in a cell ("E80"). I need to format it to 10/15/04 and paste it in

another
spreadsheet. What is doing right now is changing to today's day.... I

just
need the date, ignore the time.

I've tried Format(Date, "mm/dd/yy") and this is the one giving me todays
date...

Help... this formatting date is not making my date ...

--
gaba :)






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help formatting date

Mine had a type, should be

With Worksheets("Sheet2").Range("E80")
.Value = Worksheets("Sheet1").Range("A1").Value
. NumberFormat = "mm/dd/yy"
End With

What do you mean by take the day part? What are you aiming to do?
--

HTH

RP

"gaba" wrote in message
...
Thanks JulieD and Bob for your answers... still not working. I can't

believe
something so simple is giving me such a hard time. I think I know what the
problem is. Soon as I take the day part ("Friday,") it works (both

solutions)
perfect.
I need to find a way to Left Trim to the first ","

I'll keep trying
:)

"Bob Phillips" wrote:

Presuming you want a VBA solution

With Worksheets("Sheet2").Range("E80")
.Value = Worksheets("Sheet1").Range("A1").Value
. NumberFormat = "mm/dd/yy")
End With

--

HTH

RP

"JulieD" wrote in message
...
Hi Gaba

right mouse click on cell E80
choose format cells
on the number tab choose custom
in the white line top right type

mm/dd/yy
click Ok

Cheers
JulieD

"gaba" wrote in message
...
Hi,
I have this date and time value (Friday, October 15, 2004 10:35:12)

stored
in a cell ("E80"). I need to format it to 10/15/04 and paste it in

another
spreadsheet. What is doing right now is changing to today's day....

I
just
need the date, ignore the time.

I've tried Format(Date, "mm/dd/yy") and this is the one giving me

todays
date...

Help... this formatting date is not making my date ...

--
gaba :)









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Help formatting date

Hi Bob,
I've used your code and the only way that works is when I manualy delete the
day:
"Friday, October 15, 2004 10:38:12"
Once I got "October 15, 2004 10:38:12" the format displays "10/15/04"
That's what I mean if I can left trim to the first comma, It would display
only
"October 15, 2004 10:38:12" and work fine

Thanks in advance for all your help
g

"Bob Phillips" wrote:

Mine had a type, should be

With Worksheets("Sheet2").Range("E80")
.Value = Worksheets("Sheet1").Range("A1").Value
. NumberFormat = "mm/dd/yy"
End With

What do you mean by take the day part? What are you aiming to do?
--

HTH

RP

"gaba" wrote in message
...
Thanks JulieD and Bob for your answers... still not working. I can't

believe
something so simple is giving me such a hard time. I think I know what the
problem is. Soon as I take the day part ("Friday,") it works (both

solutions)
perfect.
I need to find a way to Left Trim to the first ","

I'll keep trying
:)

"Bob Phillips" wrote:

Presuming you want a VBA solution

With Worksheets("Sheet2").Range("E80")
.Value = Worksheets("Sheet1").Range("A1").Value
. NumberFormat = "mm/dd/yy")
End With

--

HTH

RP

"JulieD" wrote in message
...
Hi Gaba

right mouse click on cell E80
choose format cells
on the number tab choose custom
in the white line top right type

mm/dd/yy
click Ok

Cheers
JulieD

"gaba" wrote in message
...
Hi,
I have this date and time value (Friday, October 15, 2004 10:35:12)
stored
in a cell ("E80"). I need to format it to 10/15/04 and paste it in
another
spreadsheet. What is doing right now is changing to today's day....

I
just
need the date, ignore the time.

I've tried Format(Date, "mm/dd/yy") and this is the one giving me

todays
date...

Help... this formatting date is not making my date ...

--
gaba :)








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Help formatting date

Ah, the problem, then, is that the cell DOESN'T contain an Excel date and time
(which is a number), it contains text:

Dim X as String
Dim i As Long
Dim D As Date

X = Range("E80").Value
i = Instr(x, ",")
D = CDate(Trim$(Mid$(X, i + 1)))


On Tue, 26 Oct 2004 06:17:11 -0700, "gaba"
wrote:

Thanks JulieD and Bob for your answers... still not working. I can't believe
something so simple is giving me such a hard time. I think I know what the
problem is. Soon as I take the day part ("Friday,") it works (both solutions)
perfect.
I need to find a way to Left Trim to the first ","

I'll keep trying
:)

"Bob Phillips" wrote:

Presuming you want a VBA solution

With Worksheets("Sheet2").Range("E80")
.Value = Worksheets("Sheet1").Range("A1").Value
. NumberFormat = "mm/dd/yy")
End With

--

HTH

RP

"JulieD" wrote in message
...
Hi Gaba

right mouse click on cell E80
choose format cells
on the number tab choose custom
in the white line top right type

mm/dd/yy
click Ok

Cheers
JulieD

"gaba" wrote in message
...
Hi,
I have this date and time value (Friday, October 15, 2004 10:35:12)

stored
in a cell ("E80"). I need to format it to 10/15/04 and paste it in

another
spreadsheet. What is doing right now is changing to today's day.... I

just
need the date, ignore the time.

I've tried Format(Date, "mm/dd/yy") and this is the one giving me

todays
date...

Help... this formatting date is not making my date ...

--
gaba :)






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Help formatting date

Thanks Myrna. Just what I needed! Thanks everybody
g:)

"Myrna Larson" wrote:

Ah, the problem, then, is that the cell DOESN'T contain an Excel date and time
(which is a number), it contains text:

Dim X as String
Dim i As Long
Dim D As Date

X = Range("E80").Value
i = Instr(x, ",")
D = CDate(Trim$(Mid$(X, i + 1)))


On Tue, 26 Oct 2004 06:17:11 -0700, "gaba"
wrote:

Thanks JulieD and Bob for your answers... still not working. I can't believe
something so simple is giving me such a hard time. I think I know what the
problem is. Soon as I take the day part ("Friday,") it works (both solutions)
perfect.
I need to find a way to Left Trim to the first ","

I'll keep trying
:)

"Bob Phillips" wrote:

Presuming you want a VBA solution

With Worksheets("Sheet2").Range("E80")
.Value = Worksheets("Sheet1").Range("A1").Value
. NumberFormat = "mm/dd/yy")
End With

--

HTH

RP

"JulieD" wrote in message
...
Hi Gaba

right mouse click on cell E80
choose format cells
on the number tab choose custom
in the white line top right type

mm/dd/yy
click Ok

Cheers
JulieD

"gaba" wrote in message
...
Hi,
I have this date and time value (Friday, October 15, 2004 10:35:12)
stored
in a cell ("E80"). I need to format it to 10/15/04 and paste it in
another
spreadsheet. What is doing right now is changing to today's day.... I
just
need the date, ignore the time.

I've tried Format(Date, "mm/dd/yy") and this is the one giving me

todays
date...

Help... this formatting date is not making my date ...

--
gaba :)







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
conditional formatting for cell date to equal today's date Sistereinstein Excel Worksheet Functions 2 September 10th 12 07:53 PM
Formatting Date Question Boy Excel Discussion (Misc queries) 4 March 23rd 09 03:16 PM
XML date formatting Richard Roche Excel Worksheet Functions 0 December 6th 05 06:49 PM
date formatting BernieH Excel Discussion (Misc queries) 2 May 30th 05 03:33 PM
Date Colum Date Formatting & Validation Mike[_81_] Excel Programming 1 June 7th 04 01:59 AM


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