I'm using the following code in the cells [CODE] =IF(ISBLANK(Z36),"",DATEDIF(Z36,TODAY(),"d")) [CODE] When I click a blank cell it clears out the formula i have in the adjacent cells. I want the formula to stay i just want the text or number to clearout.
I assume because im using the .ClearContents its clearing everything in that cell even the formula. Any ideas?
This is the vba code im using as well
[CODE]Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case Target.Column
Case 10
Range("H" & Target.Row).Resize(, 2).ClearContents
Case 16
Range("N" & Target.Row).Resize(, 2).ClearContents
Case 4
Range("B" & Target.Row).Resize(, 2).ClearContents
Case 22
Range("T" & Target.Row).Resize(, 2).ClearContents
Case 28
Range("Z" & Target.Row).Resize(, 2).ClearContents
Case 34
Range("AF" & Target.Row).Resize(, 2).ClearContents
End Select
End Sub[CODE]
I hope that makes sense
Bookmarks