Consulting

Results 1 to 3 of 3

Thread: selected cells in yellow

  1. #1
    VBAX Regular aoc's Avatar
    Joined
    Apr 2007
    Location
    Istanbul
    Posts
    90
    Location

    selected cells in yellow

    Dear All,

    what can I do if I want below code to run automatically for all workbooks I open. I attached the file.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Cells.Interior.ColorIndex = xlNone
    Target.Interior.ColorIndex = 6
    End Sub
    Private Sub Worksheet_Deactivate()
    Cells.Interior.ColorIndex = xlNone
    End Sub
    Attached Files Attached Files
    OSMAN

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    You could move them to the Workbook_SheetChange and the Workbook_SheetDeactivate events in the ThisWorkbook code module.

  3. #3
    VBAX Regular aoc's Avatar
    Joined
    Apr 2007
    Location
    Istanbul
    Posts
    90
    Location

    no yellow cell

    Hi,

    I tried but the cell does not change. I attached the file
    Attached Files Attached Files
    OSMAN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •