+ Reply to Thread
Results 1 to 2 of 2

Highlight selected Cells

Hybrid 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:23 PM. Reason: code tags.

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Highlight selected Cells

    Welcome to the forum, you've receive your answer in the proper forum but remember to put code tags around codes. We're glad you've joined.

    Regards,
    Vladimir
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ Reply to Thread

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