EinarOSies
Board Regular
- Joined
- Feb 15, 2021
- Messages
- 61
- Office Version
- 2019
- Platform
- Windows
I am trying to incorporate some function codes into a sheet change procedure module. The function are
When I make a change in the sheet it closes excel.
Please I don't know what is wrong with my code, please any help!!!
VBA Code:
Function LastSaveDate() As Date
LastSaveDate = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time")
End Function
Function LastSavedBy()
LastSavedBy = ThisWorkbook.BuiltinDocumentProperties("Last Author")
End Function
Function ExcelAuthor()
Excel Author = ThisWorkbook.BuiltinDocumentProperties("Author")
End Function
Function ExcelFileSize()
ExcelFileSize = FileLen(ThisWorkbook.FullName)
End Function
And the change procedure code is
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C3:O39")) Is Nothing Then
On Error Resume Next
If Target.Value = "" Then
Range("C3:O39").Value = ""
Else
Range("M6").Value = LastSaveDate
End If
End If
If Not Intersect(Target, Range("C3:O39")) Is Nothing Then
On Error Resume Next
If Target.Value = "" Then
Range("C3:O39").Value = ""
Else
Range("N7").Value = LastSavedBy
End If
End If
If Not Intersect(Target, Range("C3:O39")) Is Nothing Then
On Error Resume Next
If Target.Value = "" Then
Range("C3:O39").Value = ""
Else
Range("I7").Value = ExcelFileSize
End If
End If
End Sub
Please I don't know what is wrong with my code, please any help!!!
Last edited by a moderator: