+ Reply to Thread
Results 1 to 13 of 13

Get 1st day of current and previous month - vba

  1. #1
    Registered User
    Join Date
    05-25-2014
    Posts
    34

    Get 1st day of current and previous month - vba

    Hi,

    I am wondering how to get the 1st day of the current month based on today's date and 1st day of the previous month based on todays date.
    I have tried =TODAY()-DAY(TODAY())+1 which gave me an error.

    Thank you

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Get 1st day of current and previous month - vba

    Hi and welcome to the forum,

    Something like this ?

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Registered User
    Join Date
    05-25-2014
    Posts
    34

    Re: Get 1st day of current and previous month - vba

    I've worked this out but now have a different problem. I want to take the date of one cell, cell B5 and minus 1 then print that date in cell B6. Ive got this code so far that does take the value from B5 and subtracts 1 but it pasts onto B5 and not B6.

    Please Login or Register  to view this content.
    Thanks in advance!!!

  4. #4
    Registered User
    Join Date
    05-25-2014
    Posts
    34

    Re: Get 1st day of current and previous month - vba

    Thank you GC Excel, I didn't see that comment. Could you please help with my recent problem too?

    Thanks a million!!!

  5. #5
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Get 1st day of current and previous month - vba

    Try:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-25-2014
    Posts
    34

    Re: Get 1st day of current and previous month - vba

    GC Excel, you are a legend!!! Thanks so much!

  7. #7
    Registered User
    Join Date
    05-25-2014
    Posts
    34

    Re: Get 1st day of current and previous month - vba

    Can someone help with this:

    I want to have the text Due and then the month. The month prints but not the word Due.

    Please Login or Register  to view this content.
    Thanks

  8. #8
    Registered User
    Join Date
    05-25-2014
    Posts
    34

    Re: Get 1st day of current and previous month - vba

    Can someone help with this:

    I want to have the text Due and then the month. The month prints but not the word Due.

    Please Login or Register  to view this content.
    Thanks

  9. #9
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: Get 1st day of current and previous month - vba

    Try this :

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    05-25-2014
    Posts
    34

    Re: Get 1st day of current and previous month - vba

    Amazing! Thanks GC Excel!

  11. #11
    Registered User
    Join Date
    05-25-2014
    Posts
    34

    Re: Get 1st day of current and previous month - vba

    Hi Everyone,

    I am trying to use insert slicer to connect 4 pivot graphs together. But the 'Insert Slicer' button is greyed out. It is in .xlsx format and the insert slicer works on my pivot tables but I need it for my graphs only which it doesnt work for.

    What can I do? I read online it could be privacy reasons, how can fix this?

    Any ideas?

    Thanks

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

    Re: Get 1st day of current and previous month - vba

    Please start a new thread for your last post. It's a completely different subject.
    Ben Van Johnson

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Get 1st day of current and previous month - vba

    Shalin, this is almost like hijacking your own thread lol, as suggested, please start a new thread with this question
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Formula for amount on previous month based on current month
    By Yu Marquez in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-21-2014, 12:42 AM
  2. Macro using vlookups comparing 2 months paysheet(previous month and current month)
    By srinivasan1965 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2012, 03:45 AM
  3. Replies: 5
    Last Post: 10-04-2012, 07:06 AM
  4. [SOLVED] VBA to identify the current month and previous month based on system date
    By ravikumar00008 in forum Excel General
    Replies: 10
    Last Post: 07-26-2012, 10:04 AM
  5. [SOLVED] copy worksheet from previous month and rename to current month
    By Dan E. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2005, 05:45 PM

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