date confusion

  • Thread starter evelin via OfficeKB.com
  • Start date
E

evelin via OfficeKB.com

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
 
R

Rick Rothstein

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top