VBA Formatting Problem

VbaNoob1

New Member
Joined
Aug 14, 2019
Messages
2
I'm new to VBA and I've been trying to piece together different codes to make this work, but I'm lost and could use some help.
The dataset goes from col A:X with unique numbers in the rows. Some rows are blank. I'd like to use code to evaluate each cell of each column. For example, if O3 enter image description here is < -.004 then change cell color to red else green. Each column has its own parameter, but I can figure that part out. I'd like help to create a VBA solution because each day I use a different file with the same format, but I use the same parameters to check all the cells. So I need a code to plug into the file everyday for automatic formatting.
Any help would be much appreciated!



 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
welcome to the forum

If every file is always in the same format then the formatting from a template can be applied to the daily file via VBA
- possibly as simple as copy & paste special format only

If the exact same rules can be applied every day then conditional formatting may be the simplest method to colour format each cell
- have you considered using conditional formatting ?

Have a look at this link
https://exceljet.net/conditional-formatting-with-formulas

CF rules can be set up at column level, row level, cell level etc
Multiple rules can be applied to the same range (sequence in which applied may be critical)
If you need help formulating CF conditions come back and with some more detail
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,822
Messages
6,121,770
Members
449,049
Latest member
greyangel23

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