I have two spreadsheets, one contains programs and one projects. I use D
loops to look at projects, within programs, within countries. I am trying to figure out if a set of cells for each project is blank. I have tried a few things. In the case below sustTrue
should stay at 0
if rangeVar
is blank for all the projects, but it does not. Please help!
Sub NO_Sheet()
Sheets("Program_FINAL").Select
Range("C2").Select ' C column is country
Dim IndicatorLineIterator
Do Until IsEmpty(ActiveCell) ' loop until country is blank
IndicatorLineIterator = 61
Dim PRGNum
PRGNum = ActiveCell.Offset(0, -2).Value ' Identify the program number
Sheets("Project_FINAL").Select
Range("A2").Select ' A column is the project number
Dim rangeVar, sustTrue
sustTrue = 0
Do Until IsEmpty(ActiveCell) ; loop until Project number is blank
If PRJNum = ActiveCell.Value Then
'rangeVar = ("O" & ActiveCell.Row & ":S" & ActiveCell.Row)
rangeVar = Range(ActiveCell.Offset(0, 14) & ":" & ActiveCell.Offset(0, 17))
If Not IsEmpty(rangeVar) Then
sustTrue = sustTrue + 1
MsgBox (sustTrue)
End If
End If
ActiveCell.Offset(1, 0).Select
Loop
End If
'Sheets(SheetADPName).Range("M16").Value = sustTrue
Sheets("Program_FINAL").Select
ActiveCell.Offset(1, 0).Select
Loop
End Sub