View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
L. Howard Kittle L. Howard Kittle is offline
external usenet poster
 
Posts: 698
Default how to high light cells

Hi Mike,

Perhaps try this sample of row highlighting to see if it is what you want to
happen. We can expand it to cover your range but take a look at what
happens if you click on any cell in Range("B8:K22").

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Data As Range
Dim i As Integer
Dim j As Integer
Dim k As Integer
i = 2
j = 8
k = ActiveCell.Column()
Set Data = Range("B8:K22")

Data.Interior.ColorIndex = xlNone

If ActiveCell.Row < 8 Or ActiveCell.Row 22 Or _
ActiveCell.Column < 2 Or ActiveCell.Column 11 Then
Exit Sub
End If

ActiveCell.Offset(0, -(k - i)). _
Resize(1, 10).Interior.ColorIndex = 35

End Sub

Copy and paste in a test sheet module and then click any cell in the range
B8:K22. Then click outside of that range to see what happens, which should
be nothing.

Adjusting the values of i and j plus a few changes to the code to adopt your
range will be necessary.

HTH
Regards,
Howard

"Mike" wrote in message
...
have columns from A1 to A300 TO CP1 TO CP300 if I click on a particulr
cell
on any row is it possible to high light that whole row if there is a way
please tell me how!!!