You can sellect all row and then go to Formattion - Conditional Formatting and select if cell value Contains your word 'total' then add the format you want.
jpaulino
Main Topics
Browse All TopicsHi,
I have an excel document that needs to be formatted. I have finished everything. All I need is that in column A I have the word total on a row (different row each time). I need to know how can I select this row, and then format it to be bold and highlighted yellow (I know how to do the formatting, just not the selecting)
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Here is the macro for doing so.
Sub Bold_Yellow()
ASUP = Application.ScreenUpdating
Application.ScreenUpdating
Range("A1:A999").Select
Application.CutCopyMode = False
For Each cell In Range("A:A")
If cell.Value = "Total" Then
Range("A" & cell.Row & ":" & "A" & cell.Row).Interior.ColorIn
Selection.Font.Bold = True
End If
Next
Application.ScreenUpdating
End Sub
Kind regards,
~Irial
tarigiamal:
I didn't see that the Total was only in column A. I made one adjustment to the code to only look in column A. If you need only a certain range highlighted, please let me know.
Sub FindTotal()
Dim rngFind As Range
Dim ws As Worksheet
Set ws = ActiveSheet
With ws.[A:A]
Set rngFind = .Find(What:="Total", Lookat:=xlWhole)
If Not rngFind Is Nothing Then
With rngFind.EntireRow
.Interior.Color = vbYellow
.Font.Bold = True
End With
End If
End With
End Sub
Kindest Regards,
Jaes
Nice, two different macro's which are almost the same :)
The only difference between the two macro's is that my macro loops trough each and every cell in a range, and then bolds/colors it if it contains the word "Total" in it. Loneravers macro searches for the first instance of the word Total, and then performs the same operation. Other then that they offer the same functionality.
Kind regards,
~Irial
Irial:
I usually try to not loop through every cell if I don't have to, but your solution would definitely work. A suggestion I have for your code is as follows.
With ActiveSheet
For Each cell In Intersect(.[A:A], .UsedRange)
'''
Next cell
End With
This would make it so you wouldn't loop through every cell in column A thus speeding up the code.
tarigiamal:
If you have multiple Total rows you could use the following using the Find method instead.
Sub FindTotal()
Dim rngFind As Range
Dim strAddress As String
Dim ws As Worksheet
Set ws = ActiveSheet
With ws.[A:A]
Set rngFind = .Find(What:="Total", Lookat:=xlWhole)
If Not rngFind Is Nothing Then
strAddress = rngFind.Address
With rngFind.EntireRow
.Interior.Color = vbYellow
.Font.Bold = True
End With
Do
Set rngFind = .FindNext(rngFind)
With rngFind.EntireRow
.Interior.Color = vbYellow
.Font.Bold = True
End With
Loop While Not rngFind Is Nothing And rngFind.Address <> strAddress
End If
End With
End Sub
Kindest Regards,
Jaes
Business Accounts
Answer for Membership
by: LoNeRaVeR9Posted on 2007-09-26 at 09:38:36ID: 19964531
tarigiamal:
Something like this should work for you or at least get you started.
Sub FindTotal()
Dim rngFind As Range
Dim ws As Worksheet
Set ws = ActiveSheet
With ws.Cells
Set rngFind = .Find(What:="Total", Lookat:=xlWhole)
If Not rngFind Is Nothing Then
With rngFind.EntireRow
.Interior.Color = vbYellow
.Font.Bold = True
End With
End If
End With
End Sub
Kindest Regards,
Jaes