VBAは、Is Null は使えないので、代わりにIsNull関数を使います。
Function 締め日付(締め実日, 売上日付)
締め日付 = IIf(IsNull(締め実日), 売上日付, DateSerial(Year(売上日付), Month(売上日付) + IIf(Day(売上日付) > 締め実日, 1, 0), 締め実日))
End Function
あと、VBAを使うならIf構文を使った方が読みやすいように思います。
Function 締め日付(締め実日, 売上日付)
If IsNull(締め実日) Then
締め日付 = 売上日付
Else
締め日付 = DateSerial(Year(売上日付), Month(売上日付), 締め実日)
If Day(売上日付) > 締め実日 Then 締め日付 = DateAdd("m", 1, 締め日付)
End If
End Function
通報 ...