+ Reply to Thread
Results 1 to 4 of 4

VBA Code for Date and Day of Month

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VBA Code for Date and Day of Month

    Hello:

    Could some one tell me VBA Code to insert Day,Date in A1,A2 and A3 as follows:

    A1 = Day# of Today's date eg 5/7/2007 ....A1=7
    A2 = Todays Date ................5/7/2007
    A3 = TEXT(A2,"ddd") = Mon

    7 5/7/2007 Mon

    Thank U....

    Riz Momin

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Riz,

    Please Login or Register  to view this content.
    Sincerly,
    Leith Ross

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434
    Hi Leith:

    Adding above Code ...gives Compiled Error: Sub or Function not defined...

    Please help

    Riz Momin

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434
    i got it fixed with following code....

    Cells(85, 14).Value = Date
    Cells(85, 13).Value = Format(Cells(85, 14).Value, "d")
    Cells(85, 15).Value = Format(Cells(85, 14).Value, "ddd")

    Once again many thanks to all ....

    Riz Momin

+ 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