high-lite the active cell's row when mouse cursor is in plac
Amazing chart utilities from Jon Peltier
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: high-lite the active cell's row when mouse cursor is in plac

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

    Default

     
    A file has thin row height so I can view many rows on the screen. But sometimes I get mixed up reading different cells of either the above or below ones of the active row (because of small text size, too). If someone can help me script an visible feature VBA macro to colorize the row background in light green and bold type the text from columns A to D, that'd be greatly appreciated. But the row has to return to the normal property when the mouse moves to another cell with respect to the row.

    Thank you.

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey Tan

    Do you have any prior format in that range ? I mean, do you have a background color for those cells ? same question for font...
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    99
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Juan,

    No I don't for now. Got my emails?

    T.

  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Yes.

    Try this:

    In the worksheet module


    Dim Pre As Range

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Not Pre Is Nothing Then
    If Target.Row <> Pre.Row Then
    With Pre
    .EntireRow.Interior.ColorIndex = -4142
    .Font.Bold = False
    End With
    End If
    End If
    With Target
    .EntireRow.Interior.ColorIndex = 36
    Cells(.Row, 1).Resize(1, 4).Font.Bold = True
    End With
    Set Pre = Cells(Target.Row, 1).Resize(1, 4)
    End Sub

    Regards,

    Juan Pablo González
    http://www.juanpg.com

  5. #5
    Board Regular
    Join Date
    Feb 2002
    Posts
    99
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Juan,

    I just sent you the file. It must be me; it doesn't work.

    tl

  6. #6
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Where did you put it ? in a Standard Module ?
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  7. #7
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Ok, it was in a Standar module, it should be in the Worksheet's module.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  8. #8
    Board Regular
    Join Date
    Feb 2002
    Posts
    99
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I put them in ThisWorkbook and also in Module1.

  9. #9
    Board Regular
    Join Date
    Feb 2002
    Posts
    99
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Juan,

    It works very well for single cell selection except multiple cells selection (by found that out by accident). Sorry about the instruction. Now I learn that there are three types of VBA locations: worksheet(s), thisworkbook, and modules, let alone the Personal.xls.

    Thank you JP.

    T.

  10. #10
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Hi

    I have a very simple example of this here:
    http://www.ozgrid.com/VBA/ExcelWorkbookEvents.htm
    Scroll to the bottom and look at:
    "Automatic Highlighting of Active Row"



    _________________
    Kind Regards
    Dave Hawley
    OzGrid Business Applications
    Microsoft Excel/VBA Training


    [ This Message was edited by: Dave Hawley on 2002-03-23 19:33 ]

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