I am trying to figure out a way to backup data to recover it when I need it. During the UserForm initialization I am doing
'Save Backup
Worksheets("Machine Format").Cells(ActiveCell.Column).EntireColumn.copy
which would be preferred if it's not the entire column but only rows with data, but I don't know how to combine this code with
Dim LastRow As Long
LastRow = Range("B" & Rows.Count).End(xlUp).Row
Everything I could think of didn't work, however when I try to paste previously copied data with
'Paste Backup
ActiveSheet.Paste Destination:=Worksheets("Machine Format").Cells(ActiveCell.Column)
it doesn't paste it and shows no error either. I'm not even sure if the concept of backing up data like this is an optimal or good idea.
Could someone help me, please, in solving this issue? The reason why I even need this is because I have a userform that modifies data realtime and upon closing the userform via X button I need it to cancel all the changes and I figure that I could copy the data upon userform initialization and then paste it back in if userform was closed via x button.