I'm trying to test that HearingDate(declared earlier in the code not on this page) is not blank and PET_EvidenceDue (also declared earlier) is blank, then replace PET_EvidenceDue with a formula, if true. I can't get the syntax of the integer (PET_EvidenceDue(i).Formula) for the resulting value in the For-Next loop correct. Where do I need to put the (i)? All my declared items are .databodyrange, fyi. The presence or no presence of the (i) is either erasing the column completely, just simply not running the test, or is applying the formula to the entire databodyrange.
Dim i As Integer
With PET_EvidenceDue
For i = 1 To .DataBodyRange.Rows.Count
If Len(HearingDate(i).Value) > 0 And PET_EvidenceDue(i) = "" Then
PET_EvidenceDue(i) = "=[@[Hearing Date]]-15"
End If
Next i
End With
How can I get this test to run the check and only put the formula in the appropriate columns? What am I doing wrong?
FYI- I can't use SpecialBlankCells or opposite for either column becaue neither are showing up as technically blank for some reason.
Bookmarks