Mouse point

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello,
i have a data A1:E10 now what i want if mouse point is in A1 then i want
highligh that row like A1:E1 same even if mouse would be in B1 need same high
lighting whole row A1:E1
thanks in advance
 
Right-click on your worksheet tab and select View source. Then paste this
code and see if that does what you want. I'm sure there are other ways this
could be done.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row < 11 And Target.Column < 6 _
Then
Range(Cells(Target.Row, 1), Cells(Target.Row, 5)).Select
Else
End If
End Sub

HTH,
Paul
 
Great ! that's what I was looking, now please can you let me know that how
can i put some color like green or yello A1:E1
 
This is for the background of the cells. If you want to change the font
color, use .Font.ColorIndex = <color number>

If Target.Row < 11 And Target.Column < 6 _
Then
Range(Cells(Target.Row, 1), Cells(Target.Row, 5)).Select
With Selection.Interior
.ColorIndex = 6 '4 for green, 6 for yellow
End With
Else
End If
 
Thank you very much dear.

PCLIVE said:
This is for the background of the cells. If you want to change the font
color, use .Font.ColorIndex = <color number>

If Target.Row < 11 And Target.Column < 6 _
Then
Range(Cells(Target.Row, 1), Cells(Target.Row, 5)).Select
With Selection.Interior
.ColorIndex = 6 '4 for green, 6 for yellow
End With
Else
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top