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

hi
I have set in program cell(x,2).numberformat = Dateserial(dd-mm-yy).
but while running program if cells(x,2).value= cells(x.2)+1 or cells(x,2).
value=Dateserial(yr+1,mth,dt), or cells(x,2).value=Dateserial(yr,mth,dt+1)
etc is done not always working properly if tody it works tomorrow it won't

A kinder garten type question, I know . still i long for help
thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200911/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default date confusion

The value returned from the DateSerial function is a Date, not a String...
the NumberFormat property requires a (format pattern) String. Try it this
way...

Cell(x, 2).NumberFormat = "dd-mm-yy"

--
Rick (MVP - Excel)


"evelin via OfficeKB.com" <u54234@uwe wrote in message
news:9ef199870fda6@uwe...
hi
I have set in program cell(x,2).numberformat = Dateserial(dd-mm-yy).
but while running program if cells(x,2).value= cells(x.2)+1 or cells(x,2).
value=Dateserial(yr+1,mth,dt), or
cells(x,2).value=Dateserial(yr,mth,dt+1)
etc is done not always working properly if tody it works tomorrow it won't

A kinder garten type question, I know . still i long for help
thanks

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200911/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default date confusion

hi Rick Rothstein
Thanks i have to try that

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200911/1

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 confusion manzoor New Users to Excel 2 June 16th 08 03:52 PM
Sorting pivot tables - text / date confusion malcomio Excel Discussion (Misc queries) 4 January 21st 08 01:52 PM
date confusion mepetey Excel Programming 3 December 22nd 07 02:43 PM
Confusion..... Eric @ CMN, Evansville Excel Discussion (Misc queries) 2 December 27th 05 07:15 PM
Date vs h:mm:ss confusion Barry New Users to Excel 2 November 8th 05 12:36 AM


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