i am trying to add a line(s) of code to my existing VBA script that will select the entire worksheet and change the fill color of any specific cell to #C0C0C0 given that its current fill contents are that of #993366
i am not sure what the current color of the cell is because it came prexisting from my database export.
I can see the color and make my best judgement, which is why I think it would be better to select the entire worksheet and make sure that none of the cells are colored. What do you think?
Is there a way to tell what color a specific cell is? like in M$ paint you can choose the eyedropper icon and it will choose the color that matches it.. but I am not sure how to tell which exact color on the palette i am dealing with in this situation.
Sure, just ask the cell. Select a colored cell and execute this statement in the VB editor's Immediate Window...
Code:
? ActiveCell.Interior.Color
Whatever number it prints... use that number in place of the &H996633 (do NOT put a &H in front of it... just use the number exactly the way it printed out).
Usually when you go into the VB editor, one of the windows is labeled "Immediate"... that is the Immediate Window. If you don't see it, press Ctrl+G to make it appear.
If you have the Red, Blue Green color values, you can use VB's RGB function to produce the Color value.
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.