Results 1 to 6 of 6

SelectionChange

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    10-17-2007
    Location
    Tasmania, Australia
    MS-Off Ver
    2019, 365(v2403)
    Posts
    370

    SelectionChange

    Hello,

    I have found the below VBA code and it works a charm.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Target.Cells.Count > 1 Then Exit Sub
        Application.ScreenUpdating = False
        ' Clear the color of all the cells
        Cells.Interior.ColorIndex = 0
        With Target
            ' Highlight the entire row and column that contain the active cell
            .EntireRow.Interior.ColorIndex = 8
            .EntireColumn.Interior.ColorIndex = 8
        End With
        Application.ScreenUpdating = True
    End Sub
    However, I have column headings that are shaded, and the above removes all shading from the worksheet. Which part do I need to modify to allow the top few rows to have their own colours? Rows 1:10 have heading(filled with colour) and picklists
    Last edited by davesexcel; 02-12-2013 at 10:16 PM. Reason: code tags required

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