View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
packat[_2_] packat[_2_] is offline
external usenet poster
 
Posts: 13
Default Change color of entire row and column examle

Thanks Cip / Otto fopr a quick response.
I did put the code in the worksheet code module. I also
created a bran new workbook with only one sheet,( sheet1)
and put this code
in the sheet1 code module. Nothing happened.

Somehow, Excel doesn't recognize the SelectionChange event.
I am not sure if I did turn the event off in previous
workbook. But there is nothingelse exists in this new file.

pac






packat wrote:
I am reading a book on Excel and VBA programming (for
Excel
2000). There is one example in the book that I could not
get to work.
See the code below. This code is Workbook SelectionChange
event, which is supposed to change the color of entire
rows
and columns intersecting the selected cell(s).

I am also using Excel2000. Anyone spot any error in this
code?
Thanks,
pac

-------------
Private Sub Worksheet_SelectionChange(ByVal target As
Range)
Rows.Interior.ColorIndex = 0
target.EntireColumn.Interior.ColorIndex = 36
target.EntireRow.Interior.ColorIndex = 37
Debug.Print target
End Sub
-------------