S
SkippyPB
I have the following VBA code in an Excel 2003 spreadsheet. It is
part of other code but by using Debug I have found that everything
before it executes alright. It is just this code that is not doing
its job. It is:
If Target.Column = 4 Then
Ecell = "N"
nRow = Target.Row
For nCol = 1 To 4
If IsEmpty(Worksheets("ITR Setup").Cells(nRow, nCol)) Then
Worksheets("ITR Setup").Cells(nRow, nCol).Interior.ColorIndex =
vbYellow
Ecell = "Y"
End If
Next nCol
If Ecell = "Y" Then
MsgBox "Highlighted Cells Must Contain Data"
End If
End If
By using Debug I see it execute the If IsEmpty statement. It should
be found True in my testing but the next line executed is the last End
If. It doesn't go to the Next Ncol statement.
I'd appreciate any help here.
thanks.
////
(o o)
-oOO--(_)--OOo-
"I'm not afraid of dying. I just don't want to
be there when it happens."
--Woody Allen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove nospam to email me.
Steve
part of other code but by using Debug I have found that everything
before it executes alright. It is just this code that is not doing
its job. It is:
If Target.Column = 4 Then
Ecell = "N"
nRow = Target.Row
For nCol = 1 To 4
If IsEmpty(Worksheets("ITR Setup").Cells(nRow, nCol)) Then
Worksheets("ITR Setup").Cells(nRow, nCol).Interior.ColorIndex =
vbYellow
Ecell = "Y"
End If
Next nCol
If Ecell = "Y" Then
MsgBox "Highlighted Cells Must Contain Data"
End If
End If
By using Debug I see it execute the If IsEmpty statement. It should
be found True in my testing but the next line executed is the last End
If. It doesn't go to the Next Ncol statement.
I'd appreciate any help here.
thanks.
////
(o o)
-oOO--(_)--OOo-
"I'm not afraid of dying. I just don't want to
be there when it happens."
--Woody Allen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove nospam to email me.
Steve