+ Reply to Thread
Results 1 to 8 of 8

Macro to convert cells to text or value based on date change

  1. #1
    Forum Contributor
    Join Date
    06-27-2009
    Location
    montana,USA
    MS-Off Ver
    Excel 2007
    Posts
    190

    Macro to convert cells to text or value based on date change

    I need to be able to update the date and pricing on the pricing sheet daily. however, i would like the information on the previous dates sheets (AM6:AV35) to become text when i change the date.
    For example;
    on 1/1/12 all of the prices are put in as they appear in the sample and all if the information in the first worksheet dated 1/1/12 cells AM6:AV35 is accurate.
    on 1/2/12 i change the date on the pricing sheet (J1) to 1/2/12. That will make all the data on sheet 1/1/12 (AM6:AV35) turn to text so that when i change the prices in the pricing sheet it will only update the remaining sheets.
    basically any sheet that has a date less than the date on the pricing sheet will have (AM6:AV35) become text.
    thanks in advance for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to convert cells to text or value based on date change

    Your code is password protected.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    06-27-2009
    Location
    montana,USA
    MS-Off Ver
    Excel 2007
    Posts
    190

    Re: Macro to convert cells to text or value based on date change

    i think i removed it. sorry about that.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-08-2012
    Location
    Delhi, India
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Macro to convert cells to text or value based on date change

    Hi Simpson,

    Please find attached workbook. I have created a change event code which should change the requried range into text.

    jan(1).xlsm

    let me know if that is what you needed.

    Rgds, Kaushal
    Delhi, India

  5. #5
    Forum Contributor
    Join Date
    06-27-2009
    Location
    montana,USA
    MS-Off Ver
    Excel 2007
    Posts
    190

    Re: Macro to convert cells to text or value based on date change

    That looks like it will work. It will take me some time to get it installed in the actual worbook but it appears to be exactly what I was looking for.
    GREAT FIRST POST!!
    thanks

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to convert cells to text or value based on date change

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  7. #7
    Forum Contributor
    Join Date
    06-27-2009
    Location
    montana,USA
    MS-Off Ver
    Excel 2007
    Posts
    190

    Re: Macro to convert cells to text or value based on date change

    I have been using this macro for some time with success. however, it does not run automatically like it does in the sample. It only works when i open the macros and run it. In the sample when i change the date on the pricing sheet the macro runs automatically. any ideas why this is?
    In the sample it is the only macro. In my actual workbook there are several. is this why?
    Last edited by simpson; 09-17-2012 at 06:03 PM.

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to convert cells to text or value based on date change

    Macros in the sheet module with the correct macro names can run themselves when properly designed. Macros in standard code modules (Module1, module2, etc) do not run themselves. If you put a sheet-module macro into a regular code module, they will not run themselves, they are in the wrong place.

    Any further commentary on what is actually happening in your workbook would require you to post that workbook so we can look.

+ 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