VBA color rows based on criterion

jakobt

Active Member
Joined
May 31, 2010
Messages
337
In column K there are comments. In the comment if the word "CTAX" appear, I would like to write the word Reconciled in column Q. And mark the cells from column B to K Blue in the same row.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Misread OP.
 
Last edited:
Upvote 0
Its possible but do you really want to use comments to control the use of a spreadsheet? Thats not nice design in my eyes.
 
Upvote 0
I agree with Steve, that controlling a sheet via comments is not a good way to work.
However try
Code:
Sub reconciled()
   Dim Cl As Range

   For Each Cl In Range("K2", Range("K" & Rows.Count).End(xlUp)).SpecialCells(xlComments)
      If InStr(1, Cl.Comment.Text, "ctax", 1) > 0 Then
         Cl.Offset(, 6).Value = "Reconciled"
         Cl.Offset(, -9).Resize(, 10).Interior.Color = vbBlue
      End If
   Next Cl
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top