+ Reply to Thread
Results 1 to 2 of 2

Format / Highlight the Active Cell

  1. #1
    mcastellano@gmail.com
    Guest

    Format / Highlight the Active Cell

    I have found some good solutions to my problem, but not one that fits
    the bill exactly.

    I'm looking to format the active cell with a yellow background, but I
    need to ensure that the cell's format previous to it being active
    remains as it was after the cell is no longer active. All the solutions
    I have seen remove the background after the cell is no longer active.

    So, if I have a cell with a black background (for instance) and I make
    it the active cell the cell will have a yellow background. After I
    leave that cell, I need it to return to it's previous state - black
    background, not none.

    I have tried this code...

    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object,
    ByVal Target As Excel.Range)
    Static OldRange As Range
    On Error Resume Next
    Target.Interior.ColorIndex = 6 ' yellow - change as needed
    OldRange.Interior.ColorIndex = xlColorIndexNone
    Set OldRange = Target

    End Sub

    ....and I think the answer may lie here "OldRange.Interior.ColorIndex =
    xlColorIndexNone"

    Any help would be greatly appreciated. Thank you in advance!

    -M


  2. #2
    mcastellano@gmail.com
    Guest

    Re: Format / Highlight the Active Cell

    I actually figured it out. I lock the workbook and don't allow users to
    select locked cells, but do allow users to format cells.


+ 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