Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello all, I was searching for some excel vba code that would search
column A and if the word Total is found then that row is highlighted with a color, from column A to Column G.. Any suggested vba code? Thanks... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you specifically want to use code ?
I'd suggest Conditional Formatting as an easier option. Regards Trevor "Rock" wrote in message ups.com... Hello all, I was searching for some excel vba code that would search column A and if the word Total is found then that row is highlighted with a color, from column A to Column G.. Any suggested vba code? Thanks... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For code look in the vba help index for FIND & FINDNEXT
-- Don Guillett Microsoft MVP Excel SalesAid Software "Rock" wrote in message ups.com... Hello all, I was searching for some excel vba code that would search column A and if the word Total is found then that row is highlighted with a color, from column A to Column G.. Any suggested vba code? Thanks... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Rock,
Try this: Sub test() Dim iEnd As Long, i As Range, iRng As Range iEnd = Cells(Rows.Count, 1).End(xlUp).Row Set iRng = Range(Cells(1, 1), Cells(iEnd, 1)) For Each i In iRng If i.Value = "Total" Then With i.Resize(, 6).Interior .ColorIndex = 36 .Pattern = xlSolid End With End If Next i End Sub -- Dan |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is some code using Find/FindNext
Sub ColourTotals() Dim rngFound As Range Dim strFirstAddress As String Set rngFound = Columns("A").Find(What:="total", _ LookAt:=xlPart, _ LookIn:=xlValues, _ MatchCase:=False) If Not rngFound Is Nothing Then strFirstAddress = rngFound.Address Do rngFound.Resize(, 7).Interior.ColorIndex = 40 Set rngFound = Columns("A").FindNext(rngFound) Loop Until rngFound.Address = strFirstAddress End If End Sub -- HTH... Jim Thomlinson "Rock" wrote: Hello all, I was searching for some excel vba code that would search column A and if the word Total is found then that row is highlighted with a color, from column A to Column G.. Any suggested vba code? Thanks... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Total column changes colors when total equals sum of other columns | New Users to Excel | |||
how can you highlight or color your total line in a Pivot table R | Excel Worksheet Functions | |||
How to click and highlight cells and calculate the total amount in MS Excel? | Excel Programming | |||
When i highlight cells, I USED to get total in bottom rt corner? | Excel Worksheet Functions | |||
highlight cells to obtain total without using formula? | Excel Discussion (Misc queries) |