Announcement

Collapse
No announcement yet.

Highlight Row of Selected Cell

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Highlight Row of Selected Cell



    I want to highlight the entire row where a selected cell is. For instance, I select a cell in row 5, I want the entire row to be highlighted. If I then select a cell in Row 8, I want Row 5 to return to normal, and Row 8 to be highlighted.
    Answers???

  • #2
    Originally posted by Joe Spy
    I want to highlight the entire row where a selected cell is. For instance, I select a cell in row 5, I want the entire row to be highlighted. If I then select a cell in Row 8, I want Row 5 to return to normal, and Row 8 to be highlighted.
    Answers???
    Hi Joe

    Have a look here for 2 methods

    http://www.xcelfiles.com/Excel02.html#anchor_54
    Kind Regards,
    Ivan F Moala From the City of Sails

    http://www.xcelfiles.com

    Comment


    • #3
      Highlight row of selected cell

      Ivan,

      Thanks for the link. However, the code there doesn't quite do what I want it to do. I will take a stab at it, though, on a test workbook.

      I only want this to work on a specific sheet in my workbook...not all sheets.

      Comment


      • #4
        Place the code in the Worksheet that you want it to work in....post back if you require help
        Kind Regards,
        Ivan F Moala From the City of Sails

        http://www.xcelfiles.com

        Comment


        • #5
          Highlight Row of Selected Cell

          Thanks for the help. I did paste the code in the right place. It worked as advertised, but it wasn't what I wanted. I instead changed the Range to look like the following:

          Range("A" & Target.Row, Target.EntireRow)

          This fixed the problem and selects the entire row of the selected cell. PERFECT!

          -- Joe

          Comment


          • #6
            Re: Highlight row of selected cell

            I only want this to work on a specific sheet in my workbook...not all sheets.[/QUOTE]

            Try this code:
            Code:
            Private Sub Worksheet_SelectionChange(ByVal Target As Range)
            
            ActiveSheet.Rows(Target.Row).Select ' highlite entire row
            Target.Activate                               ' select the cell
            
            End Sub
            Last edited by royUK; December 31st, 2005, 18:10. Reason: add code tags

            Comment


            • #7
              Re: Highlight Row of Selected Cell

              Here is an easy way for coloring the corresponding row of your selected cell

              1. Choose an empty cell on your worksheet (e.g. $A$200 in this example)

              2. Place this code in the Worksheet_SelectionChange event:
              (press ALT+F11)

              Private Sub Worksheet_SelectionChange(ByVal Target As Range)
              ActiveSheet.Range("A200").Value = Target.Row
              End Sub

              The code will set the row value in the spefified cell ($A$200) each time a cell is selected

              3. Set a Conditional formatting rule for all cells you want to highlight:
              set the conditional formatting-formula as follows:

              =ROW()=$A$200

              Good Luck!

              Pro-Profit.nl

              Comment


              • #8
                Re: Highlight Row of Selected Cell

                Hey newbie here haha. I would very much appreciate some help with highlighting rows in excel whenever the characters: "Rx", "R", "C", and "S" are entered down column A8 - A (any #).

                I would to highlight the rows: RX - Red; R - Orange; C - Green and ; S- Yellow. I would appreciate the VBA code as I continually keep screwing it up haha. Thanks in advance


                Lonnie

                Comment


                • #9
                  Re: Highlight Row of Selected Cell

                  You can use conditional formatting to do that. You'll need to lock the comparison to the first column and apply it to the rows you want starting with row 8. The formula and applies to sections should be something like: =$A8="RX" and: Sheet1!$8:$999 respectively.

                  Comment


                  • #10
                    Re: Highlight Row of Selected Cell

                    Originally posted by _lh View Post
                    You can use conditional formatting to do that. You'll need to lock the comparison to the first column and apply it to the rows you want starting with row 8. The formula and applies to sections should be something like: =$A8="RX" and: Sheet1!$8:$999 respectively.
                    Excel 2003 would only allow me to do conditional formatting with 3 conditions/colours only From what I understand, having 4 conditions I require VBA code to do that.
                    could yourself or anyone else help me with the code or a way around the CF limit?

                    Comment


                    • #11


                      Re: Highlight Row of Selected Cell

                      Lonnieg3,

                      Please read the forum rules- start a new thread for your questions and do not post your questions in thread started by others.
                      If you want, in your thread provide a link to this one.
                      AAE
                      ----------------------------------------------------

                      Forum Rules | Message to Cross Posters | How to use Tags

                      Comment

                      Working...
                      X