I have created a program with 3 visible sheets and 3 hidden sheets. The hidden sheets store information from the visible sheets. When 1 of the visible sheets is changed, the user has the option of saving the changes. If they choose to save the changes it updates the hidden page related to it.
In creating this program, I have repeated tested this, typically using only one of the sheets. I tell you this only to find out if doing this is the cause of my problem.
My problem is that the program works fine for awhile and then suddenly begins running EXTREMELY slow, but only on the sheet that I repeatedly tested on. Running the same code on the other sheets and it runs fine.
The first time this happened, I thought perhaps the one sheet got corrupted somehow, so I completely recreated it. It seemed to fix the problem, but only for a while b/c it is back.
Some sample code:
I did not include all the code from the sub, just the code that is being run when excel starts running slowly. All the variables used here are defined, I just didn't show the code.
Does anyone see something wrong with this code? Perhaps the way I am copying and pasting? Or does something happen behind the scenes when I copy and paste over and over again?
Also, the sheet itself becomes very slow. Scrolling up and down the sheet becomes extremely slow even when I am not running code.
Thoughts please, this is driving me nuts.
Thanks
In creating this program, I have repeated tested this, typically using only one of the sheets. I tell you this only to find out if doing this is the cause of my problem.
My problem is that the program works fine for awhile and then suddenly begins running EXTREMELY slow, but only on the sheet that I repeatedly tested on. Running the same code on the other sheets and it runs fine.
The first time this happened, I thought perhaps the one sheet got corrupted somehow, so I completely recreated it. It seemed to fix the problem, but only for a while b/c it is back.
Some sample code:
Code:
Select Case MsgBox("Do you wish to save the changes?", vbYesNo + vbQuestion, "Nerve Charts Unlimited")
Case vbYes
ActiveSheet.Unprotect
ActiveSheet.Range(PatName).Select
ActiveSheet.Range(OrigRange).Copy Sheets(X).Range(OrigRange)
ActiveSheet.Range(Note).Copy Sheets(X).Range(Note)
ActiveSheet.Shapes("TextBox 3").Fill.ForeColor.SchemeColor = 10
ActiveSheet.Shapes("TextBox 3").TextFrame.Characters.Text = "Change Template"
ThisWorkbook.Save
SetBack = ThisWorkbook.Saved
Case vbNo
Sheets(X).Range(OrigRange).Copy ActiveSheet.Range(OrigRange)
Sheets(X).Range(Note).Copy ActiveSheet.Range(Note)
ActiveSheet.Unprotect
ActiveSheet.Shapes("TextBox 3").Fill.ForeColor.SchemeColor = 10
ActiveSheet.Shapes("TextBox 3").TextFrame.Characters.Text = "Change Template"
ActiveSheet.Range(PatName).Select
ActiveSheet.Range(PatName) = "Name"
ActiveSheet.Range(StartDate) = Date
'Change = False 'skips update in screening sheet
ThisWorkbook.Saved = SetBack
End Select
I did not include all the code from the sub, just the code that is being run when excel starts running slowly. All the variables used here are defined, I just didn't show the code.
Does anyone see something wrong with this code? Perhaps the way I am copying and pasting? Or does something happen behind the scenes when I copy and paste over and over again?
Also, the sheet itself becomes very slow. Scrolling up and down the sheet becomes extremely slow even when I am not running code.
Thoughts please, this is driving me nuts.
Thanks