+ Reply to Thread
Results 1 to 9 of 9

Formatting cell in same row as active cell, then reset format on row selection change

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007/2010
    Posts
    20

    Formatting cell in same row as active cell, then reset format on row selection change

    Hello,

    I have the following code, which will format the cell in column D of the same row of the active cell, changing the font to bold and color to red. This works, except when another cell is selected in a differet row, I need to reset the format of the column D cell that was just changed. How do I reset the format of that cell (bold=false, color=black)?

    Any help would be much appreciated!


    Code:
    Please Login or Register  to view this content.
    Last edited by jellyjen17; 01-25-2012 at 07:38 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Formatting cell in same row as active cell, then reset format on row selection ch

    Don't select the cell

    Please Login or Register  to view this content.

    Regards, TMS
    Last edited by TMS; 01-25-2012 at 05:57 PM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    12-09-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007/2010
    Posts
    20

    Re: Formatting cell in same row as active cell, then reset format on row selection ch

    Hello,

    I tried this, but to no avail. Same problem is happening. After a cell in a different row is selected, the column D cell of the previously selected cell remains bold font and color red.

  4. #4
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Formatting cell in same row as active cell, then reset format on row selection ch

    I think it would be easier to do with conditional formatting, but for this method you need to store the previous cell
    Please Login or Register  to view this content.
    Good luck.

  5. #5
    Registered User
    Join Date
    12-09-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007/2010
    Posts
    20

    Re: Formatting cell in same row as active cell, then reset format on row selection ch

    Hi TMS,

    This worked like a charm, thank you much! I did think about conditional formatting, but can you conditional format a cell based strictly on the selection or activation of another cell? I wasn't sure how to do that either or if it was even possible and just figured a vba code solution would be easier to find.

    thanks again!

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Formatting cell in same row as active cell, then reset format on row selection ch

    Much as I'd like to take the credit ... and I was planning on coming back with something similar ... it was actually OnErrorGot0 that answered the question for you.


    Regards, TMS

  7. #7
    Registered User
    Join Date
    12-09-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007/2010
    Posts
    20

    Re: Formatting cell in same row as active cell, then reset format on row selection ch

    Oops, I didn't even see that! Sorry, & thank you much OnErrorGot0 for your help! Thank you both for such timely responses as well!

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Formatting cell in same row as active cell, then reset format on row selection ch

    You're welcome.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  9. #9
    Registered User
    Join Date
    12-09-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007/2010
    Posts
    20

    Re: Formatting cell in same row as active cell, then reset format on row selection ch

    Will do, thank you!

+ 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