+ Reply to Thread
Results 1 to 6 of 6

Replacing "Yes" with End of Month Date

  1. #1
    Registered User
    Join Date
    12-24-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Replacing "Yes" with End of Month Date

    Hey All:

    I'm building a monthly Excel report that will run on Macros, and I need some help with some formulas. In every report there will be cells that contain the words "Yes." I need a way to replace the "Yes" with the last day of the month. An Example:

    I run the report on the 14th of December, and I receive 12 "Yes" fields as a result. I want a formula to take all the "Yes" fields, and replace them with the last day of the month (in this example, 12/31/13). Since this report will be run everyday for the forseeable future, the 'End of Month date' field would have to update automatically.

    Since these reports will be run on a daily basis, it would be too cumbersome to manually use a 'replace with' filter. I'm trying to find a way to completely automate it; this way I can macro the entire process. This is the final outcome that I'd like:

    Depending on which month I am running the report in, Excel automatically finds and displays the last date of that month, and then takes that date, and replaces all the "Yes" fields with the last date of the month.

    Please Help!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Replacing "Yes" with End of Month Date

    Not possible to do with formulas unless you use a macro to insert the formula into the cells in question.

    However, if you're already using macros for other things then use a macro to replace the cells in question with the last day of the month. Why do you want a formula?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Replacing "Yes" with End of Month Date

    This code placed in the object module of the worksheet containing the data will find every cell whose content is the string "Yes" and replace it with the date of the last day of the month in which when the macro is run.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Registered User
    Join Date
    12-24-2013
    Location
    China GuangZhou
    MS-Off Ver
    Excel 2003 &2007 & 2010
    Posts
    16

    Re: Replacing "Yes" with End of Month Date

    I think it's this.

    HTML Code: 

  5. #5
    Registered User
    Join Date
    12-24-2013
    Location
    China GuangZhou
    MS-Off Ver
    Excel 2003 &2007 & 2010
    Posts
    16

    Re: Replacing "Yes" with End of Month Date

    This's OK.
    HTML Code: 
    HTML Code: 

  6. #6
    Registered User
    Join Date
    04-13-2010
    Location
    Taiwan
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Replacing "Yes" with End of Month Date

    There is a function called EOMONTH(start_date,months)
    you can simply input the following formula in the cell
    Please Login or Register  to view this content.

+ 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] Excel 2007: How to Convert "5/2/2013" to "May" then subtract a Month so it's "Apr"
    By Golom in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-19-2013, 02:00 AM
  2. [SOLVED] Convert string "MMM-yy" to date in VBA and then find the previous month
    By behumble in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-09-2013, 12:32 AM
  3. [SOLVED] Removing ".", "?" or "!" from last word of sentence and replacing it later in vba.
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2013, 07:20 AM
  4. Return "green", "yellow" or "red" from date/age and priority ranking
    By Cantaloop in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-04-2013, 12:12 AM
  5. Convert "Date" to week & month Month automatically
    By ajxxx in forum Excel General
    Replies: 7
    Last Post: 11-16-2008, 04:20 PM

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