I have code below that where D19 on sheet "Depreciation" has a value that is not zero, then a comment must be inserted/displayed in cell D22 on sheet "Recon"
I get a run time error "end if without block if"
It would be appreciated if someone could amend my code
I get a run time error "end if without block if"
It would be appreciated if someone could amend my code
Code:
Sub Comments()
With Sheets("Depreciation")
If .Range("D19").Value <> 0 Then
Sheets("Imported Data").Range("D22").ClearComments
Exit Sub
Else:
With Sheets("Recon")
.Range("D22").ClearComments
.Range("D22").AddComment.Comment.Visible = True
.Comment.Text Text:="Depreciation not yet processed"""
.Comment.Shape.Select True
Selection.ShapeRange.IncrementLeft -65#
Selection.ShapeRange.IncrementTop 40#
Selection.ShapeRange.ScaleHeight 0.85, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleWidth 0.95, msoFalse, msoScaleFromBottomRight
End If
End With
End With
end Sub