nested if statements VBA

InWonderland

New Member
Joined
Apr 17, 2013
Messages
1
I am trying to write a nested if statement that if column W = "Correct" and column AA is empty then the blanks will colour in. I have tried a number of different ways and I'm hoping I'm getting close with the coding below. I am doing several checks on my worksheet that's why I need this to be in vba. Can anyone help?

Code:
[COLOR=#444444][FONT=Calibri]  Dim I, j As Long

   For I = 4 To NumberOfRows[/FONT][/COLOR][COLOR=#444444][FONT=Calibri]    [/FONT][/COLOR]
[COLOR=#444444][FONT=Calibri]    For j = 1 To 52[/FONT][/COLOR]
[COLOR=#444444][FONT=Calibri]    If j = 23 Then[/FONT][/COLOR]
[COLOR=#444444][FONT=Calibri]       If Range("W4").Value = "Correct" And Range("A4").Value Then[/FONT][/COLOR]
[COLOR=#444444][FONT=Calibri]                MsgBox "No entry for " & Cells(1, 27) & " on row " & I & " ", , "MissingData"[/FONT][/COLOR]
[COLOR=#444444][FONT=Calibri]             End If[/FONT][/COLOR]
[COLOR=#444444][FONT=Calibri]          End If[/FONT][/COLOR]
[COLOR=#444444][FONT=Calibri]        [COLOR=#222222][FONT=Verdana]
[/FONT][/COLOR][/FONT][/COLOR]
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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