IF, Then VBA w/Conditional Formatting Question

rrrepp

New Member
Joined
Nov 2, 2011
Messages
10
Hi I'm really having trouble with this VBA. I'm average at best at using Visual Basic, but i've got a general understanding. I'm trying to look at two columns that have the answer 'yes' or 'no' in them (Column N & Column O) and depending on it being a yes i'd like to highlight a cell offset. If yes in Column N, then highlight cell in E. If yes in Column O, then highlight cell in K. Here is the code i've been writing but i keep getting errors at every turn. Thanks for the help.

Sub ConditionalFormat()

Dim ColN As Range
Dim ColO As Range

Set ColN = ActiveSheet.Range("N54:N425")
Set ColO = ActiveSheet.Range("O54:O425")
If ColN = Yes Then
Cell.Offset(0, -9).Interior.ColorIndex = 27
ElseIf ColO = Yes Then
Cell.Offset(0, -4).Interior.ColorIndex = 27
Else
End If
End Sub
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,225,060
Messages
6,182,616
Members
453,127
Latest member
IMagill

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