+ Reply to Thread
Results 1 to 5 of 5

VBA or Conditional Format to change font on scroll

  1. #1
    Registered User
    Join Date
    06-05-2021
    Location
    Ohio, USA
    MS-Off Ver
    2019
    Posts
    14

    VBA or Conditional Format to change font on scroll

    In over my head...help. I need to create code to change the font color in A4 to white when a user scrolls down to row 15. This is my failed attempt:

    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you (and indentation) this time because you are a new member. --6StringJazzer

    Or is there a conditional formatting formula I could use instead?

    Spreadsheet attached.... sample.xlsm
    Attached Files Attached Files
    Last edited by 6StringJazzer; 01-26-2023 at 02:32 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,691

    Re: VBA or Conditional Format to change font on scroll

    If you want this code to work on a specific sheet, put it in the module for that sheet.

    There is no built-in event to determine that the user has scrolled, but you can use the ChangeSelection event which will trigger if they click on any cell. It is possible to write some complicated code to detect scrolling but I'm not sure it's worth it, depending on exactly how you want this to work.

    I put this code in your Test sheet module. Any time you select a cell, it will turn the font white if row 15 is visible on the screen.
    Please Login or Register  to view this content.
    If you really really need to detect scrolling let me know and we'll go down that rabbit hole.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    06-05-2021
    Location
    Ohio, USA
    MS-Off Ver
    2019
    Posts
    14

    Re: VBA or Conditional Format to change font on scroll

    Thank you for the quick response. However, It stays white even after row 15 is no longer visible. How do I get it to change back to black in that case?

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,691

    Re: VBA or Conditional Format to change font on scroll

    Well to be fair you didn't ask for that.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-05-2021
    Location
    Ohio, USA
    MS-Off Ver
    2019
    Posts
    14

    Re: VBA or Conditional Format to change font on scroll

    Got it. Thanks.

+ 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. Replies: 1
    Last Post: 07-31-2021, 03:23 PM
  2. Replies: 9
    Last Post: 12-08-2020, 04:15 PM
  3. [SOLVED] Conditional Format VBA - Change Text Box Font Color
    By joelyyc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-23-2014, 11:38 AM
  4. Conditional format formula need to change font colour
    By Si902 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-2010, 09:57 AM
  5. conditional format formula to change font color
    By johncena in forum Excel General
    Replies: 3
    Last Post: 06-30-2010, 04:17 AM
  6. [SOLVED] Change default font format in Excel
    By Michael Lortz in forum Excel General
    Replies: 3
    Last Post: 12-16-2005, 09:50 PM
  7. [SOLVED] Can one change the font or format of a sheet name?
    By KMcGrail in forum Excel General
    Replies: 2
    Last Post: 06-14-2005, 06:05 AM

Tags for this Thread

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