VBA code assistance - adding interior cell background color to weekly report

bootj1234

Board Regular
Joined
Aug 27, 2012
Messages
85
The following image shows a report I produce on a weekly basis that I would appreciate assistance in creating VBA code to automate adding in the various cell interior background colors. It’s important to note that I would like the finished code to treat the cell range as dynamic since the number of rows within the report can change from week to week.

I am not sure, but I believe that using the identification of key words and numbers could aid in getting code to recognize where various interior cell background colors get applied; that is:


  1. The words (ADD, REMOVE, KEEP – Paid Advertisers) in column A would call out which rows would have RGB(128, 128, 128) applied as the interior cell background color.


  1. The number 0.5 located in column D cells would call out which cells would have RGB(255, 230, 153) applied as the interior cell background color.


  1. The column header word “Rotation” in column E would call out that the background color RGB(248, 203, 173) to be applied as the interior cell background color to those cells that have no color applied to them.


  1. The column header “Airtime Start Date” in column J would call out and apply the background color RGB(180, 198, 231) within cells in-between rows “ADD” and “REMOVE” that have a date in them. If there is no date in the cell, then no color would be applied to the cell interior.


  1. The column header “Airtime End Date” in column K would call out and apply the background color RGB(180, 198, 231) within cells in-between rows “REMOVE” and “KEEP – Paid Advertisers” that have a date in them. If there is no date in the cell, then no color would be applied to the cell interior.

Thank you for your consideration and support in providing me with the code that will allow the accomplishment of my report automation goal.


a3frqf.png
[/IMG]
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,214,387
Messages
6,119,225
Members
448,877
Latest member
gb24

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