Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Highlight Cells


Good Morning Programmers,

I am looking for a code that will put a color (say yellow) in the
active cell, but also the next 2 to 3 cells to the right of the active
cell. Or maybe it possibe to highlight the entire row of an active
cell, that would be good also.

This is for a long phone number list, that I will use a Find box. Once
the box moves over the name that is found, highlight the entire row.
Wherever the active cell is located, highlight that row.

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=483546

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Highlight Cells

Cells.Interior.ColorIndex = xlNone
set rng = Columns(3).Find("1234567")
if not rng is nothing then
rng.Select
rng.EntireRow.Interior.ColorIndex = 6
End if

--
Regards,
Tom Ogilvy


"EMoe" wrote in message
...

Good Morning Programmers,

I am looking for a code that will put a color (say yellow) in the
active cell, but also the next 2 to 3 cells to the right of the active
cell. Or maybe it possibe to highlight the entire row of an active
cell, that would be good also.

This is for a long phone number list, that I will use a Find box. Once
the box moves over the name that is found, highlight the entire row.
Wherever the active cell is located, highlight that row.

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile:

http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=483546



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Highlight Cells

Hi:

Sub Macro1()
i = Selection.Row
j = Selection.Column
Range(Cells(i, j), Cells(i, j + 2)).Select
With Selection.Interior
.ColorIndex = 6
End With
End Sub

will color the selected cell and the next couple of cells to the right.
Will run if one cell is selected for each macro run.
--
Gary's Student


"EMoe" wrote:


Good Morning Programmers,

I am looking for a code that will put a color (say yellow) in the
active cell, but also the next 2 to 3 cells to the right of the active
cell. Or maybe it possibe to highlight the entire row of an active
cell, that would be good also.

This is for a long phone number list, that I will use a Find box. Once
the box moves over the name that is found, highlight the entire row.
Wherever the active cell is located, highlight that row.

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=483546


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Highlight Cells


Thanks for the reply.

Tom, I tried your code, and I couldn't get anything to happen.
Gary, your code runs with the macro to highlight the cells
permanently.

I'm looking for some sort of *change event * that whenever the active
cell is moved, via the arrow keys or mouse, that corresponding row
becomes highlighted. Then changes as the active cell is moved.

I saw a code once that highlights the cell that is active, but I need
the entire row to become highlighted.

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=483546

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Highlight Cells

Did you have the string "1234567" in column 3 or did you change it to look
for a phone number in the proper column? You said you were trying to find a
number.

This is for a long phone number list, that I will use a Find box.


--
Regards,
Tom Ogilvy


"EMoe" wrote in message
...

Thanks for the reply.

Tom, I tried your code, and I couldn't get anything to happen.
Gary, your code runs with the macro to highlight the cells
permanently.

I'm looking for some sort of *change event * that whenever the active
cell is moved, via the arrow keys or mouse, that corresponding row
becomes highlighted. Then changes as the active cell is moved.

I saw a code once that highlights the cell that is active, but I need
the entire row to become highlighted.

Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile:

http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=483546





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Highlight Cells


Tom with the box, I will search for a name that is in column one. The
phone number associated with that name is located in column 3. I don't
quit understand what you mean by using 1234567 as a string though.

I would love to see your explanation, however I was able to come across
this code:

Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static rr
If rr < "" Then
With Rows(rr).Interior
..ColorIndex = xlNone
End With
End If
r = Selection.Row
rr = r

With Rows(r).Interior
..ColorIndex = 6
..Pattern = xlSolid
End With
End Sub


Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=483546

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Highlight Cells

Great, don't try to copy and paste on that worksheet.

--
Regards,
Tom Ogilvy


"EMoe" wrote in message
...

Tom with the box, I will search for a name that is in column one. The
phone number associated with that name is located in column 3. I don't
quit understand what you mean by using 1234567 as a string though.

I would love to see your explanation, however I was able to come across
this code:

Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Static rr
If rr < "" Then
With Rows(rr).Interior
ColorIndex = xlNone
End With
End If
r = Selection.Row
rr = r

With Rows(r).Interior
ColorIndex = 6
Pattern = xlSolid
End With
End Sub


Thanks,
EMoe


--
EMoe
------------------------------------------------------------------------
EMoe's Profile:

http://www.excelforum.com/member.php...o&userid=23183
View this thread: http://www.excelforum.com/showthread...hreadid=483546



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
highlight cells bruceo Excel Discussion (Misc queries) 4 January 12th 09 06:17 PM
how to highlight more related cells if cell highlight Jon Excel Discussion (Misc queries) 5 December 21st 08 01:06 PM
Highlight cells in a row with a given value evoxfan Excel Discussion (Misc queries) 3 September 2nd 08 05:59 PM
Highlight cells with ctrl-click but only un-highlight one cell hagan Excel Discussion (Misc queries) 5 May 27th 05 06:45 PM
Highlight cells Julian Campbell Excel Worksheet Functions 1 December 1st 04 10:49 PM


All times are GMT +1. The time now is 06:17 AM.

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

About Us

"It's about Microsoft Excel"