I am setting up an Excel worksheet for work. I have a column with a formula that is automatically updating the number of days it has been since I have sent something to Germany. I have a checkbox that shows if I have received it back from Germany. If the box is checked, then the value of the formula is copied and pasted in the same cell location, so that it removes the formula to keep it from updating. I am trying to make this worksheet fool-proof, so the next thing I want to do is re-add the formula if the box is unchecked. I'm getting an error 1004 on this second part.
Sub CheckBox3470_Click()
If ThisWorkbook.Worksheets("IPT RMAs").Shapes("Check Box 3470").OLEFormat.Object.Value = 1 Then
Range("K44").Copy
Range("K44").PasteSpecial xlPasteValues
Else
Range("K44").Formula = "=IF(ISBLANK(J43),"",TODAY()-J43)"
End If
End Sub
Any ideas on what I've done wrong here? Thanks!
Aucun commentaire:
Enregistrer un commentaire