+ Reply to Thread
Results 1 to 22 of 22

Do-Over When cell changes, highlight first empty row and record change

  1. #1
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Do-Over When cell changes, highlight first empty row and record change

    Re-post with updates. Apologies

    I'm creating a log sheet for checking characteristics of items. I'd like to create a way to automatically record when the characteristic spec changes by highlighting the next empty row and recording the change into my last used cell in that row.

    So it would do something like this;

    Current spec is located in cell D7 and is 6.6"
    When D7 is changed to 7.7", look for first blank cell in column A (let's say it is A16)
    Highlight A16:F16 and in F16 record the change "6.6" changed to 7.7""

    However D7 mentioned above is on sheet 2 and is a reference to cell A9 on sheet 1.

    Please see the attached example

    Thanks for any help!
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    At present, the value in D7 on sheet 2 is returned by a formula referring to A9 of sheet1. Therefore, D7 will change only when A9 changes. The problem with automatically doing what you asked is that it would require a Worksheet_Change macro and this type of macro is not activated when a change to a cell is the result of a formula. It would work if you reversed the formula, placing it in A9 and having it refer to D7. In this manner, you would manually change D7 triggering the macro and A9 would update according to the formula. Would it work for you if you reversed the location of the formula?
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    Unfortunately I cannot do that. I have to have the headers in sheet 2 populate from sheet 1. Could the macro be placed in sheet 1 and start on the change of A9?

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    You are exactly right. Copy and paste the following macros into the worksheet code module. Do the following: right click the tab for your "Before 1" sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make your change in A9.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    This is great! Just one question: Is there any way to edit this so that say if I change A9 twice or more on sheet 1 before making another entry to the log on sheet 2 that the macro would just overwrite what it previously recorded in column F sheet 2?

    My concern is that someone would accidentally type the wrong change into cell A9 sheet 1, press enter, then immediately correct the mistake, and now sheet 2 recorded that the spec changed twice due to the error.

    Also, these sheets will be protected. How do I adjust for that?
    Last edited by MDW12; 04-05-2016 at 10:48 AM.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    That is possible but it would mean that you would only have the most recent change in sheet 2. You wouldn't have a running record of all changes. Is this what you want?

  7. #7
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    No I'd rather have it as is. I can always manually fix it if necessary.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    Sounds good.

  9. #9
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    I'm am still struggling about the protection of the sheets. Not sure where I need to add in the unprotect and protect lines. Thanks!

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    Do you want to protect all the sheets or just some of them? Do you want to use a password to protect them? Also you will have to decide which cells on the protected sheets you want to access so you can enter or modify data in them.

  11. #11
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    I would like all of the sheets to be password protected. I have identified which cells I want to allow access to by changing their protection to Unlocked.

  12. #12
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    Start by manually protecting your sheets with the password and then try the following:
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    This looks like it's working perfectly! Thank you very much Mumps1 I appreciate the help!

  14. #14
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    You are very welcome.

  15. #15
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    Could anyone help me expand this to include the same thing for the second part characteristic? I thought I would be able to figure this out myself but haven't been able to.

  16. #16
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    By "second part characteristic" do you mean "Punch Hole Location" as in your sample file and possibly more characteristics in column A? Please explain in detail.

  17. #17
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    Correct, that's exactly what I mean. I have hundreds of workbooks like this with varying numbers of characteristics that would be in column A. My goal is do this for each of them.

  18. #18
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    Try:
    Please Login or Register  to view this content.

  19. #19
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    That's very close but with this code it still changes D7 on sheet 2 instead of just the related cell(E7) when punch hole location is edited

  20. #20
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    I didn't realize that you had formulas in D7 and E7 on sheet 2. Make sure that the formulas in those two cells are still there and try the following:
    Please Login or Register  to view this content.
    By the way, it looks like there can be only 2 characteristics, length and location. Is this true?

  21. #21
    Registered User
    Join Date
    04-04-2016
    Location
    Ohio, USA
    MS-Off Ver
    2010
    Posts
    26

    Re: Do-Over When cell changes, highlight first empty row and record change

    This looks to be working very well!
    For this part there are only 2 characteristics, however, for most of the other parts I have workbooks for there are many more characteristics.(color, diameters, thickness, correct components, profile, etc.)

  22. #22
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Do-Over When cell changes, highlight first empty row and record change

    Glad it's working for you.

+ 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. When cell changes, highlight first empty row and record change
    By MDW12 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2016, 07:40 AM
  2. Highlight row if cell is empty
    By phifer2088 in forum Excel General
    Replies: 3
    Last Post: 02-20-2015, 05:58 AM
  3. [SOLVED] Highlight First Empty Cell In a Row
    By b624333 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2015, 03:39 PM
  4. Replies: 2
    Last Post: 08-01-2013, 10:27 PM
  5. [SOLVED] VBA to record cell reference values as text and record change
    By Katie O in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2013, 12:14 PM
  6. Replies: 4
    Last Post: 06-26-2011, 11:56 PM
  7. [SOLVED] Delete record if cell is empty
    By Metrazal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-21-2006, 05:43 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