+ Reply to Thread
Results 1 to 7 of 7

Excel VBA or Formula how to set cell to first day of the month

  1. #1
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Excel VBA or Formula how to set cell to first day of the month

    I want to select one cell in my worksheet to have a date of 1st of the month. when I open worksheet no matter which day of the month Or Which month that cell show the date of the 1st day of the current month.

    Thanks

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Excel VBA or Formula how to set cell to first day of the month

    try this UDF function

    Please Login or Register  to view this content.
    paste above code into standard module and refer to it in cell You need to i.e. A1 formula = ThisMonthFirstDay()
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

  3. #3
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Excel VBA or Formula how to set cell to first day of the month

    Sorry, did not work for me may be I am doing something wrong here, I have few sheet in my workbook, how I am able to set this to sheet1, cell a5 ?

    Please explane,

    Thanks
    RR

  4. #4
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Excel VBA or Formula how to set cell to first day of the month

    this is global function You have to copy my code into Module and then in Sheet1 in cell a5 set formula "=ThisMonthFirstDay()"

  5. #5
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Excel VBA or Formula how to set cell to first day of the month

    Thanks a lot it work now,

  6. #6
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Excel VBA or Formula how to set cell to first day of the month

    Your Welcome !

  7. #7
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Canada
    MS-Off Ver
    Office 365
    Posts
    165

    Re: Excel VBA or Formula how to set cell to first day of the month

    When I open workbook today it did not change to June 1st, It work last time when I set it in may.

+ 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