ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Condition Formatting in code. How? (https://www.excelbanter.com/excel-programming/370109-re-condition-formatting-code-how.html)

raypayette[_45_]

Condition Formatting in code. How?
 

Put this in the WorkSheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
Cells(2, 2).Select
If Cells(2, 2) 5 Then ActiveCell.Interior.Color = vbWhite
End Su

--
raypayett

-----------------------------------------------------------------------
raypayette's Profile: http://www.excelforum.com/member.php...fo&userid=2956
View this thread: http://www.excelforum.com/showthread.php?threadid=57074


Corey

Condition Formatting in code. How?
 
Thanks for the reply,

I placed the code you posted inot the sheets code but i get a 'Select method
of range class failed' error.

I have the code i posted in a module and run it from a call macroxx

I think i have a simple error in the 'TODAY()' area??

Corey....
"raypayette" wrote
in message ...

Put this in the WorkSheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
Cells(2, 2).Select
If Cells(2, 2) 5 Then ActiveCell.Interior.Color = vbWhite
End Sub


--
raypayette


------------------------------------------------------------------------
raypayette's Profile:
http://www.excelforum.com/member.php...o&userid=29569
View this thread: http://www.excelforum.com/showthread...hreadid=570740





All times are GMT +1. The time now is 03:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com