Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Highlight CURRENT row

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Posts
    231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have a tremendously long spreadsheet and have to enter information in many columns pertaining to the information in the first two columns. Sometimes I can not tell if I'm on the correct row... so what I'd like to be able to to is...

    Whatever row my cursor is currently in, I would like that entire row to highlight itself. (Perferably in a yellow highlight format). Is this something I can do in Excel?

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    London, UK
    Posts
    167
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    copy this code onto the module relating to the sheet you want it to operate on...

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Cells.Interior.ColorIndex = xlNone

    With Target.EntireRow.Interior
    .ColorIndex = 37
    .Pattern = xlGray25
    .PatternColorIndex = 24
    End With
    End Sub



    ...otherwise, i've never needed to do this, i suggest if you don't already know how to take advantage of FREEZE PANES in the WINDOW menu, then you start playing with it, it will probably help you out without you needing any code solution.

    [ This Message was edited by: daleyman on 2002-04-03 12:58 ]

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    London, UK
    Posts
    167
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    sorry, for yellow use the same but with:

    .ColorIndex = 2
    .Pattern = xlGray75
    .PatternColorIndex = 19

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

    Default

    I'm not familiar with FREEZE PANES... can I get a little info... thanks.

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Location
    London, UK
    Posts
    167
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    oh, you'll love it then

    go to a cell in your huge list, say, cell F2 to freeze columns A-D and row 1, then go to the window menu and select freeze panes.

    D.

  6. #6
    Board Regular
    Join Date
    Apr 2002
    Posts
    231
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I tried the FREEZE PANES, just before I got your last post. Awesome. However, I was only able to freeze a horizontal row (which is a big help, b/c that was another of my issues, I can't see the heading as I get further down in the sheet). However, I don't see how to use FREEZE PANES for the columns (or IF I can even freeze in both directions).

    Also, about the aforementioned code... I copied it to a module... but nothing. I am assuming I then run a macro, but it's not there. Can I get a little more help. Thanks.

  7. #7
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Actually, I think yellow is 6, at least in xl2000. I skinned this cat a little differently, similar result:

    Code:
    Private n As Range
    Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
    On Error GoTo 1
    n.EntireRow.Interior.ColorIndex = xlNone
    target.EntireRow.Interior.ColorIndex = 6
    1: Set n = Selection
    End Sub
    As in the previous post, you need to right-click on the worksheet tab in question, select "view code" and paste the macro in the module that should appear (worksheet module).

    _________________
    Cheers, NateO

    [ This Message was edited by: NateO on 2002-05-21 12:18 ]

  8. #8
    Board Regular
    Join Date
    Mar 2002
    Location
    London, UK
    Posts
    167
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Roni > goto same menu and do unfreeze panes, then try again from a different cell. play with it.

    NateO > yeah, nice, just don't like bold colours and went for a pastel shade, ha ha.

  9. #9
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Daley, I think the more mellow yellow is 36. Liked your code too.

    Have a good one.

  10. #10
    New Member
    Join Date
    Apr 2002
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    To SEE HEADING, select cell below HEADING and FREEZE PANES from there. Will scroll both x and y axis.

    dennisdjones

Some videos you may like

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
  •