Newb needs script to search for value in column and apply formatting to line

Detroiter

New Member
Joined
May 14, 2014
Messages
6
Hello Gurus,

I have a problem that I'm hoping I can get some assistance with:

I have a spreadsheet with two tabs that need formatting applied to certain lines.

In column A - if the word "Total" appears (It can be mixed with other characters), I need the line turned grey and the text bolded until column AY.

Any assistance would be greatly appreciated!

Cheers,

Detroiter
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
You can use Conditional Formatting to do this.

1. Select columns A to AY for all the possible rows you want to apply this to
2. Open Conditional Formatting
3. Go to the Formatting option, and enter this formula:
Code:
=ISNUMBER(SEARCH("Total",$A1))
Note: You may need to adjust this. This should be written as it pertains to your first row in your selected range. If anything other than 1, change A1 to match that starting row number
4. Choose your formatting options
5. Click OK
 
Upvote 0
You could use conditional formatting for this.

Select columns A to AY
Click conditional formatting, New rule
Select use formula to determine which cells to format

Enter the formula: =FIND("Total",$A1)

If the text could be 'total' or 'TOTAL' then wrap the $A1 in the lower function: =FIND("total",LOWER($A1))
 
Upvote 0
Hi All,

Thank you so much for the feedback! I should have mentioned this in my original post, but it slipped my mind: I need to embed this into an existing VBS script. How would this be coded?

Thank you again,

D
 
Upvote 0
Do you mean Excel VBA code, or VBS script (outside of Excel)?

If VBA code, turn on the Macro Recorder and record yourself performing these steps manually, and you should get most of the code that you need to do this.
If VBS Script, I cannot help with that.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,089
Messages
6,128,750
Members
449,466
Latest member
Peter Juhnke

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