On my form there is a textbook which comments are written. I need it to save the comments every time the file is closed and when opened again the comments should appear. It should also save any editing done.
[COLOR=#ff0000]I[/COLOR][COLOR=#ff0000]n ThisWorkbook module[/COLOR]
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Save
ThisWorkbook.Saved = True
End Sub
Private Sub Workbook_Open()
UserForm1.Show
End Sub
[COLOR=#ff0000]In userform code window[/COLOR]
Private Sub TextBox1_Change()
Sheets("SheetName").Range("A1").Value = Me.TextBox1.Text
End Sub
Private Sub UserForm_Activate()
Me.TextBox1.Text = Sheets("SheetName").Range("A1").Value
End Sub
Private Sub UserForm_Initialize()
Me.TextBox1.Text = Sheets("SheetName").Range("A1").Value
End Sub