What I need to do is clear the cell in column D if the cell in column A in the same row is blank. Column D does not have a formula in it.
Column A extracts it value from another worksheet in the same workbook but sometimes the user deletes that value in the other worksheet and now the column A is blank and the value in column D that was written into it is orphaned and has no place to go.
The following code will not work on my worksheet apparently because I have a formula in column A. So what would be the equivalent?
Columns("A:A").SpecialCells(xlCellTypeBlanks).Offset(0,3).ClearContents
I tried the following code and it works but the worksheet sure appears agitated before it finally settles down and accepts the consequence:
sub test()
LastRow = Range("A" & Rows.Count).End(xlUp).Row
For i= 1 to lastrow
If Range("A" & i) = "" then
Range("D" & i).clearcontents
End If
Next
End Sub
Bookmarks