+ Reply to Thread
Results 1 to 14 of 14

Macro to Highlight ActiveRow w/ DoubleClick

  1. #1
    Registered User
    Join Date
    02-12-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    24

    Macro to Highlight ActiveRow w/ DoubleClick

    Hi,

    I am trying to use the code below to highlight the active row with a double-click but it's been a dud. The user is double-clicking on a GL Account Number in column A and I would like that particular row (A:W) to format to a style I defined as "Highlight".

    Any advice on my mistake is appreciated.

    Please Login or Register  to view this content.
    I don't think it matters, but I am successfully running this code on the same worksheet. The user is double-clicking a GL Account Number and it is being pasted into cell A1, which ultimately fuels some index formulas.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,417

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    Do you have a "Style" in your workbook that is named "Highlight"?
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    02-12-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    Yes I do, but I am open to hard-coding the format rather than referencing a style. I just want it to bold and highlight in an off yellow.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    Does this help?

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-12-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    It is still not working. It is not failing with a bug, but the macro is not changing the sheet.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    Where did you get the 2 from?

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-12-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    I added it in there myself because the other macro running on the same sheet has the same generic name.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    I don't think you can modify an event code like that take the 2 out and see if it works. Your original might work as well.

  9. #9
    Registered User
    Join Date
    02-12-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    That fixed it! Great catch, but it will not allow me to run two macros with the same name, any thoughts on how I can execute both macros on the same worksheet?

    Also, is it possible to have the highlight removed upon double-clicking the next selection? I can not clear all highlights because I have some rows highlighted within that range for other purposes, but I only want one row highlighted in yellow at any given time.

    Thank you much for all the help!

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    Try this and see if it does what you want.

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 10-23-2014 at 11:02 AM.

  11. #11
    Registered User
    Join Date
    02-12-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    Perfect! Thank you. I see that I can double click the GL Acct Number a second time and it will clear the highlight.

    Thanks!

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    You're welcome. Glad to help out and thanks for the feedback.

  13. #13
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,100

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    @ JOHN H. DAVIS,

    Nice work John!

    You could also add:

    Please Login or Register  to view this content.

    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  14. #14
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro to Highlight ActiveRow w/ DoubleClick

    @ Winon: Thanks for the pointers, I should know that by now. And do it as a matter of habit. But I'll try to keep it in mind.

+ 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 2010, checkbox macro to change text upon doubleclick of cell?
    By fredderf81 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-13-2013, 02:35 AM
  2. DoubleClick Macro giving error on other computers
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-31-2013, 01:20 PM
  3. [SOLVED] Open listbox and doubleclick one line and run macro
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-18-2013, 12:33 PM
  4. Replies: 1
    Last Post: 01-17-2013, 05:27 PM
  5. VBA Copy activerow to another sheet
    By ronvannost in forum Excel General
    Replies: 1
    Last Post: 05-12-2010, 12:46 AM

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