+ Reply to Thread
Results 1 to 3 of 3

Start dates in excel vba

  1. #1
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    261

    Start dates in excel vba

    The below code doesnt give the first date of the month, while if i just use the below date function in a excel sheet It works well. Please help
    whats wrong in the below code. For example if input in A1 15/05/2013. It should give value in C1 as 01/05/2013


    Please Login or Register  to view this content.
    Last edited by grkchakri; 05-05-2013 at 04:20 PM. Reason: solved

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Start dates in excel vba

    Range("c1").Value = DateSerial(Year(Range("a1").Value), Month(Range("a1").Value), 1)
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    02-12-2011
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007
    Posts
    261

    Re: Start dates in excel vba

    Thanks ton

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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