Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I stop excel from automatically highlighting cells? | Excel Discussion (Misc queries) | |||
Auto extract data & inserts rows additional rows automatically | Excel Discussion (Misc queries) | |||
Highlighting the lowest cell automatically | Excel Discussion (Misc queries) | |||
Automatically highlighting cells | Excel Discussion (Misc queries) | |||
Why does a file open up automatically when only highlighting the . | Excel Discussion (Misc queries) |