Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Automatically highlighting rows which contains certain data

In my Excel Workbook, I want the macro to find every row which
contains a cell containing the text "Robert" and then highlight this
row my shading it light grey.

The number of rows containing "Robert" changes all the time.

I know I need a Do ... Until statement, however I can't seem to come
to grips with the syntax and how to fit it into the macro.

Thanks.

Ian M
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Automatically highlighting rows which contains certain data

The following code behind the workbook will detect the entry as it is made
and set the row to grey if the cell contains Robert and reset it to no fill
if the word is removed

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
With Sh
With Target
If .Cells.Text = "Robert" Then
Rows(Target.Row).Interior.ColorIndex = 15
Else
Rows(Target.Row).Interior.ColorIndex = xlNone
End If
End With
End With
End Sub


"Ian M" wrote in message
om...
In my Excel Workbook, I want the macro to find every row which
contains a cell containing the text "Robert" and then highlight this
row my shading it light grey.

The number of rows containing "Robert" changes all the time.

I know I need a Do ... Until statement, however I can't seem to come
to grips with the syntax and how to fit it into the macro.

Thanks.

Ian M



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Automatically highlighting rows which contains certain data

Nigel

This works perfectly.

Thank you for your help.

Kind regards

Ian M



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
How do I stop excel from automatically highlighting cells? Kyle E Excel Discussion (Misc queries) 3 April 3rd 23 01:18 PM
Auto extract data & inserts rows additional rows automatically Meeru Excel Discussion (Misc queries) 3 September 9th 09 01:46 PM
Highlighting the lowest cell automatically Frances Holden Excel Discussion (Misc queries) 1 January 7th 08 02:48 PM
Automatically highlighting cells sponger02 Excel Discussion (Misc queries) 1 May 24th 07 08:05 PM
Why does a file open up automatically when only highlighting the . L. DeRita Excel Discussion (Misc queries) 0 February 22nd 05 02:47 PM


All times are GMT +1. The time now is 02:36 PM.

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"