Results 1 to 5 of 5

Highlight selected cells

Threaded View

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Ft Worth
    MS-Off Ver
    Excel 2010
    Posts
    4

    Highlight selected cells

    Hello folks,

    This is my first post so I ask that you be kind :-)

    I have a worksheet that I want to highlight the selected cells to a different color and place a letter in column A to indicate that color for those that are color blind.

    I am currently using the following code for this, which works well when the user selects a continuous set of cells. However, if they select a set of rows and then select another set of rows that are not continuous, I get less than satisfactory results. Any suggestions?

    Private Sub ColorAvailable_Click()
     R = ActiveCell.Row 'First Row
     X = Selection.Rows.Count + R - 1 'Last Row of selection
     With Selection.Interior
     .PatternColorIndex = xlAutomatic
     .Color = 5296274
     .TintAndShade = 0
     .PatternTintAndShade = 0
     End With
     Do Until R > X
     Range("A" & R).Select
     ActiveCell.FormulaR1C1 = ""
     R = R + 1
     Loop
     End Sub
    Last edited by vlady; 11-06-2012 at 07:24 PM. Reason: code tags.

Thread Information

Users Browsing this Thread

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

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