+ Reply to Thread
Results 1 to 16 of 16

Macro to check if data has changed and append to another cell

  1. #1
    Registered User
    Join Date
    11-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    15

    Macro to check if data has changed and append to another cell

    Could you provide me with help with creating a macro to do the following please?

    1. If user wishes to change the date in Column B the date currently held in column B needs to append to the data in Column C and is formatted with strikethrough.
    2. If user wants to change the estimate in Column D the original estimate needs to append to data in Column E and is formatted with striokegthrough
    3. If user changes the status of the project to Complete a message box appears to ask for the completed data and this is copied into column I
    4. Once user has added the completion date the whole range from a-I is copied into the complete worksheet and added to next available blank line.
    5. Once all data has been update I want to copy the range a2:I??end , open a word template and copy it into the bookmark area projects.
    Attached Files Attached Files

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro to check if data has changed and append to another cell

    brigitte,

    all steps but the last one.

    add the following routines to the worksheet Data

    Please Login or Register  to view this content.
    create a new module, and insert the following code

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  3. #3
    Registered User
    Join Date
    11-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro to check if data has changed and append to another cell

    Hi Ollie, this is absolutely brilliant and does everything I asked for. Thank you very much you are a star.

    I have just taken out the line 'rngTarget.Parent.Rows(rngTarget.Row).Delete' because I want to keep this data for that reporting period but then want to delete it the following month. Therefore I need another routiune that checks on opening the workbook if the completed project on the data worksheet has been copied into the complete worksheet and deletes the project data from the data worksheet. Do you have any ideas?

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro to check if data has changed and append to another cell

    I think you are better off using a button that, when clicked by the user, removes all project rows with a completion date in the previous month (as determined by the current date) after asking the user whether he/she is really sure. The routine below can be linked to such a command button, or can be called from within the workbook_open event. Up to you :-)

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro to check if data has changed and append to another cell

    Again, this works brilliantly, and I agree, adding it to a button is better solution.

    With regard to opening a word template and then copying this data across. Although I have had some replies, none of them have worked, whereas yours have worked first time.

    Thank you

  6. #6
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro to check if data has changed and append to another cell

    If you want assistance on the export to Word please provide a copy of the Word document and a description of what you would like to happen.

  7. #7
    Registered User
    Join Date
    11-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro to check if data has changed and append to another cell

    Thank you Olli. I have added a copy of the word document that is created when opening a new document from my template. I am unable to upload the template for you to see as ti doesn't accept the file extension. Below is what I want to achieve:

    1. Once the user has finished updating their report I want them to press a button, which opens a new word document from a template called "monthly report.dotm" from their 'my template' area
    2. I then want it to copy the data from the worksheet "data" from within the sample workbook you have been working with. Goto the bookmark "projects" in the new word doument and paste the data range.

    I hope this is clear enough for you

    Brigitte
    Attached Files Attached Files

  8. #8
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro to check if data has changed and append to another cell

    Please post the template in a zip file (that is allowed) and I will have a go at writing a solution for you

  9. #9
    Registered User
    Join Date
    11-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro to check if data has changed and append to another cell

    Hi Ollie, that would be absolutely fantastic. I have therefore attached a zip file with the template in.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    11-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro to check if data has changed and append to another cell

    Hi Ollie, I have transferred the excel workbook to another laptop and I am now getting an error message ' cannot find project or library'. Do you have any suggestions on how to resolve this?

  11. #11
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro to check if data has changed and append to another cell

    brigitte, I noticed that there are some special project references which also prevented me from compiling any code. Hence I have only posted the code as text and did not include any workbook to you. Go to Tools/Reference and "deselect" those references with a text MISSING:. That should solve your problem as I do not think you require them. I will try to work on your document export this weekend.

  12. #12
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro to check if data has changed and append to another cell

    brigitte, we never really discussed what you would like to have written into the Projects bookmark section of the Word template so I have just provided the framework below. It should be quite easy to expand on. Perhaps by adding a table to the Projects section and filling that in. Note that the code assumes that the document template will be available in the same directory as the workbook itself.

    Try this

    Please Login or Register  to view this content.

  13. #13
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro to check if data has changed and append to another cell

    I just noticed you wanted to paste the table on the data worksheet. Revised code below

    Please Login or Register  to view this content.

  14. #14
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro to check if data has changed and append to another cell

    Hi Brigitte, is this solution working for you?

  15. #15
    Registered User
    Join Date
    11-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro to check if data has changed and append to another cell

    Hi Ollie

    Sorry I haven't replied to your messages, unfortunately my husband died at the end of January and I have only just returned to work. I have a few changes to my spreadsheet that I would like some help with, would you be able to look at these for me?

    Brigitte

  16. #16
    Registered User
    Join Date
    11-12-2012
    Location
    Bristol
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Macro to check if data has changed and append to another cell

    Could I have some assistance in making the cell bold in Column B when date has been changed and has been copied across to column C?

+ 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