Correction Macro

MR3

Board Regular
Joined
Jun 10, 2008
Messages
175
Current XL Sheet (Before Macro):


http://g.imageshack.us/g.php?h=383&i=beforeif8.png

After Macro XL Sheet (After Macro):


http://g.imageshack.us/g.php?h=383&i=afteroz1.png

*****************************************************

Before XL Sheet: All the formulas are in place. The data in the Column C is formatted white.

After the Macro is run I would like all that data to turn Black and then fill the "FALSE" rows to be Red.

So far the code I have is:

Sub Correction_Macro()
Range("C1").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=INT(C1)=FALSE"
Selection.FormatConditions(1).Interior.ColorIndex = 2
Selection.Copy
FinalRow = Range("C15000").End(xlUp).Row
Range("C2:C" & FinalRow).Select
Selection.PasteSpecial Paste:=xlPasteFormats
End Sub

Help would be greatly appreciated, THANKS!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,961
Office Version
  1. 365
Platform
  1. Windows
Perhaps:

Code:
Sub test()
Dim lastrow As Long
lastrow = Range("C15000").End(xlUp).Row
Range("A:C").FormatConditions.Delete
Range("C:C").Font.Color = vbBlack
With Range("A3:C" & lastrow).FormatConditions
    .Add Type:=xlExpression, Formula1:="=RC3=FALSE"
    .Item(1).Interior.Color = vbRed
End With
End Sub
 
Upvote 0

MR3

Board Regular
Joined
Jun 10, 2008
Messages
175
Thanks alot! Code works. However, it locks the color to red once the code is run. It wont let me change it back to "No Fill" Manually.
 
Upvote 0

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,961
Office Version
  1. 365
Platform
  1. Windows
No, because it's Conditional Formatting.
You have to delete the Formatting Condition to turn it off.
 
Upvote 0

Forum statistics

Threads
1,191,718
Messages
5,988,271
Members
440,146
Latest member
rgomes8

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
Top