Results 1 to 11 of 11

How do I restore Cell Background Color in VB Script while using Excel

Threaded View

  1. #1
    Registered User
    Join Date
    09-04-2022
    Location
    USA
    MS-Off Ver
    Microsoft Office Professional Plus 2021
    Posts
    6

    How do I restore Cell Background Color in VB Script while using Excel

    I am supporting with some seniors on voluntary basis for a non profit organization.
    Some of them have difficulty to identify the active cell . So I followed the instruction as per YouTube
     [https:]//[youtu.be/VJczGRH-4Ro]  Sorry I am unable to post link so i have added brackets.
    The important script I am using is

    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Cells.Interior.ColorIndex = xlColorIndexNone
    Target.EntireColumn.Interior.ColorIndex = 8
    Target.EntireRow.Interior.ColorIndex = 8
    Target.Interior.ColorIndex = 7
    End Sub
    This works perfectly fine for highlighting the active cell. Basically it will highlight active row, active column and active cell background in different color.
    Unfortunately while moving from one cell to another cell, the background color of active row, column and cell is reset to normal.
    How do I restore the background color?

    So basically If my understanding is correct before entering the cell, I need to store the current background of row, column and cell in a variable. while leaving I should restore back.
    I am not sure how do I read? what function I should store? what function I should restore?
    Since I am new to VB Script, request your help.

    Thank you
    Last edited by cathsg; 09-05-2022 at 11:50 AM. Reason: solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel - background cell color
    By karyx in forum Excel General
    Replies: 5
    Last Post: 10-20-2017, 02:24 AM
  2. Using excel macro to create script to restore cryptolocker
    By norman1nz in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-26-2016, 11:00 PM
  3. Replies: 8
    Last Post: 04-02-2016, 04:00 AM
  4. Change cell background color based on another cells background color
    By Queo in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 06-10-2014, 05:28 AM
  5. Replies: 6
    Last Post: 11-07-2012, 10:46 AM
  6. Restore cell grid background
    By km4hr in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-16-2006, 04:57 PM
  7. how do I restore background grid in Excel?
    By roopuppy in forum Excel General
    Replies: 2
    Last Post: 11-11-2005, 06:45 PM

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