+ Reply to Thread
Results 1 to 2 of 2

converting dates to numbers and numbers to dates

  1. #1
    Registered User
    Join Date
    05-11-2005
    Posts
    12

    converting dates to numbers and numbers to dates

    I am going crazy here. I am looking at a code, and basically there was a cell that looks like this:
    traindate ---- 2005/12/21 and they converted this to a number simply by going traindate = ActiveCell
    and traindate=right(traindate, 10)
    and then they pasted this in a random cell and changed the cell format to general and bada bing we have a number. Now I want to know how to do this manually. If i type a date into a cell and then convert to general i still only have a date. How in the world do you do this, and why did it work in his case. If i type a number into a cell and click format date, then i get a date from the number, but not the other way around for some reason????
    thanks

  2. #2
    Registered User
    Join Date
    09-11-2005
    Posts
    5
    i would like to do the same thing. I have some fields that i would like to format with a for loop. I have
    For iDate = 1 to NumOfDates
    Sheets("requests").Cells(4, tDate * 2 + 1).Value = Format(StartDate + Format(tDate, "d"), "d-mmm")
    Next

    i know formatting an integer doesnt change its data type but i hope you can see my drift.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1