Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Again about Row Highlighting [HELP]

Hello,
I saw many post in this newsgroup about row highlighting,
this code written by jemcgimpsey I found in this newsgroup works well:

-----------
Private Sub Worksheet_SelectionChange(By Val Target As Excel.Range)
Static oldRange as Range
Static colorIndices(256) As Integer
Dim i As Integer
If Not oldRange Is Nothing Then 'Restore color indices
For i=1 to 256
Cells(oldRange.row, i).Interior.ColorIndex=colorIndices(i)
Next i
End If
For i = 1 to UBound(colorIndices)
colorIndices(i)=Cells(ActiveCell.row,i).Interior.C olorIndex
Next i
ActiveCell.EntireRow.Interior.ColorIndex=15
Set oldRange=ActiveCell.EntireRow
End Sub
----------

Now I need your help because I'd like to to have highlighted only the
cell on coloumn "A" - not the entire Row.
I'm sure you Excel experts can easly change this code, I'd be greatful
if
somebody can help me.

Thanks,
Ale.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Again about Row Highlighting [HELP]

Private Sub Worksheet_SelectionChange(By Val Target As Excel.Range)
Static oldRange as Range
Static colorIndices As Integer
Dim i As Integer
If Not oldRange Is Nothing Then 'Restore color indices
Cells(oldRange.row, 1).Interior.ColorIndex=colorIndices
End If
colorIndices=Cells(Target(1).row,1).Interior.Color Index
cells(Target(1).Row,1).Interior.ColorIndex=15
Set oldRange=Cells(Target(1).Row,1)
End Sub

--
Regards,
Tom Ogilvy


"Alex" wrote in message
om...
Hello,
I saw many post in this newsgroup about row highlighting,
this code written by jemcgimpsey I found in this newsgroup works well:

-----------
Private Sub Worksheet_SelectionChange(By Val Target As Excel.Range)
Static oldRange as Range
Static colorIndices(256) As Integer
Dim i As Integer
If Not oldRange Is Nothing Then 'Restore color indices
For i=1 to 256
Cells(oldRange.row, i).Interior.ColorIndex=colorIndices(i)
Next i
End If
For i = 1 to UBound(colorIndices)
colorIndices(i)=Cells(ActiveCell.row,i).Interior.C olorIndex
Next i
ActiveCell.EntireRow.Interior.ColorIndex=15
Set oldRange=ActiveCell.EntireRow
End Sub
----------

Now I need your help because I'd like to to have highlighted only the
cell on coloumn "A" - not the entire Row.
I'm sure you Excel experts can easly change this code, I'd be greatful
if
somebody can help me.

Thanks,
Ale.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Again about Row Highlighting [HELP]

THANKS FROM ITALY.
IT WORKS GREAT, THANK YOU AGAIN FRIEND,

Ale.


"Tom Ogilvy" wrote in message ...
Private Sub Worksheet_SelectionChange(By Val Target As Excel.Range)
Static oldRange as Range
Static colorIndices As Integer
Dim i As Integer
If Not oldRange Is Nothing Then 'Restore color indices
Cells(oldRange.row, 1).Interior.ColorIndex=colorIndices
End If
colorIndices=Cells(Target(1).row,1).Interior.Color Index
cells(Target(1).Row,1).Interior.ColorIndex=15
Set oldRange=Cells(Target(1).Row,1)
End Sub

--
Regards,
Tom Ogilvy

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
highlighting Jane Griffel[_2_] Excel Discussion (Misc queries) 2 February 11th 09 06:07 PM
highlighting Jade Excel Discussion (Misc queries) 1 July 2nd 08 04:54 PM
Highlighting a Row Fufu Excel Worksheet Functions 2 March 17th 06 10:16 PM
Highlighting blanks via GO TO SPECIAL is not highlighting blank cells - HELP, I'm totally stuck. Jamie Furlong Excel Discussion (Misc queries) 6 August 28th 05 09:27 PM
Highlighting changes yolanda Excel Discussion (Misc queries) 1 February 10th 05 08:53 PM


All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"