Highlight CURRENT row - Page 2
Thanks Thanks:  0
Likes Likes:  0
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Highlight CURRENT row

  1. #11
    Board Regular
    Join Date
    Feb 2002
    Location
    North Alabama, USA
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Roni,
    Have you tried Windows, New Window, New Window, Arrange, Horizantal. Neat for comparing or whatever.
    Hope this helps!

    Rocky

    <h6>"Be not the first by whom the New are try'd,
    Nor yet the last to lay the Old aside."
    Alexander Pope (1688-1744).</h6>

  2. #12
    Board Regular
    Join Date
    Oct 2002
    Location
    Syed Musharraf Ali
    Posts
    259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    hi,
    Following code is working fine, but problem is that when I copy a cell and paste another location it does not allow. Plz help.


    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
    Cells.Interior.ColorIndex = xlNone
    With Target.EntireRow.Interior
    .ColorIndex = 37
    .Pattern = xlGray25
    .PatternColorIndex = 24
    End With
    End Sub

  3. #13
    New Member
    Join Date
    Oct 2002
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    This is normal when using the "Workbook_SheetSelectionChange" Event, however you can use "Drag & Drop" whitin the sheet or you can set EnableEvents= False and enable it again when needed.

    I use a macrobutton for this.

    Sub Copy_Paste()
    Dim xText As Variant

    If Application.EnableEvents = True Then
    Application.EnableEvents = False

    Cells.FormatConditions.Delete
    Application.CommandBars("JFP_FLS").Controls("Event On").Caption = "Event Off"

    Else
    If Application.EnableEvents = False Then
    Application.EnableEvents = True
    Application.CommandBars("JFP_FLS").Controls("Event Off").Caption = "Event On"

    End If
    End If
    End Sub

    Regards John

  4. #14
    Board Regular
    Join Date
    Mar 2002
    Posts
    362
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hi,
    This highlight code is one of the best i've found. It will not only highlight your row but, your column as well. Also, it will not remove any previous colors you've placed on your sheet.

    *Right click on sheet tab, view code, paste their;

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim iColor As Integer
    '/// Ivan F Moala's code modified by Nate by request
    '// Amended routine found on this Web site
    '// Note: Don't use IF you have Conditional
    '// formating that you want to keep!

    '// On error resume in case
    '// user selects a range of cells
    On Error Resume Next
    iColor = Target.Interior.ColorIndex
    'Leave On Error ON for Row offset errors

    If iColor < 0 Then
    iColor = 37
    Else:
    iColor = iColor + 1
    End If

    '// Need this test incase Font color is the same
    If iColor = Target.Font.ColorIndex Then iColor = iColor + 1

    Cells.FormatConditions.Delete

    '// Horizontal color banding
    With Rows(Target.Row)
    .FormatConditions.Add Type:=2, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = iColor
    End With

    '// Vertical color banding
    With Range(Target.Offset(1 - Target.Row, 0).Address & ":" _
    & Target.Offset(-1, 0).Address) 'Rows(Target.Row)
    .FormatConditions.Add Type:=2, Formula1:="TRUE"
    .FormatConditions(1).Interior.ColorIndex = iColor
    End With

    End Sub



    Good luck,
    Noir


User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com