I have created a macro that logs the changes of each cell in the comments of that cell but for some reason, I keep getting an "Out of Memory" error. This is being called from a userform. Can someone please tell me why I keep getting this error? Code below:
Thanks
Code:
Sub LogChanges(RowImIn As String)
Dim varComment As String
Dim c As Comment
With ActiveSheet.Cells(RowImIn, 11)
On Error Resume Next
Set c = .Comment
On Error GoTo 0
If c Is Nothing Then
ActiveSheet.Cells(RowImIn, 11).AddComment "Updated on " & Format(Now(), "mm/dd/yy hh:mm") & " by " & Inits & " from " & ActiveSheet.Cells(RowImIn, 11).Value
Else
varComment = c.Text
ActiveSheet.Cells(RowImIn, 11).ClearComments
ActiveSheet.Cells(RowImIn, 11).AddComment varComment & vbNewLine & "Updated on " & Format(Now(), "mm/dd/yy hh:mm") & " by " & Inits & " from " & ActiveSheet.Cells(RowImIn, 11).Value
End If
End With
End Sub
Code:
Function Inits() As String
Dim objword As Object
Set objword = CreateObject("Word.Application")
Inits = objword.UserInitials
objword.Quit
End Function
Thanks
Last edited: