Hi
I am trying to speed up the execution of my code for a few userforms and make it as streamlined as possible. I have read up and seen in my own code that applying Application.ScreenUpdating = False at the start of the sub and Application.ScreenUpdating = True at the end (though it should turn off at the end of the sub procedure) speeds up VBA code because it is not interacting with the Excel interface when switched off.
I have 3 userforms that all have textboxes, listboxes and command buttons to perform specific functions such as initiate, change, *******, Keypress, afterupdate and terminate. I am unclear when to apply Application.ScreenUpdating = False and when to apply Application.ScreenUpdting = True at the most appropriate points as well as when not to apply this to userform/control event. Is it safe to put just on the initiate event when opening the userform, all userform events or in specific parts of the events that are performing specific commands. My code ranges from changing the userform control properties by cycling through each form control as well as working with worksheets, ranges and arrays. A specific points values are copied to the worksheet from the userform textboxes and vice versa depending on the task being undertaken and I find that this is a lot quicker with screenupdating turned off.
Any help will be much appreciated.
Thanks
Steve
I am trying to speed up the execution of my code for a few userforms and make it as streamlined as possible. I have read up and seen in my own code that applying Application.ScreenUpdating = False at the start of the sub and Application.ScreenUpdating = True at the end (though it should turn off at the end of the sub procedure) speeds up VBA code because it is not interacting with the Excel interface when switched off.
I have 3 userforms that all have textboxes, listboxes and command buttons to perform specific functions such as initiate, change, *******, Keypress, afterupdate and terminate. I am unclear when to apply Application.ScreenUpdating = False and when to apply Application.ScreenUpdting = True at the most appropriate points as well as when not to apply this to userform/control event. Is it safe to put just on the initiate event when opening the userform, all userform events or in specific parts of the events that are performing specific commands. My code ranges from changing the userform control properties by cycling through each form control as well as working with worksheets, ranges and arrays. A specific points values are copied to the worksheet from the userform textboxes and vice versa depending on the task being undertaken and I find that this is a lot quicker with screenupdating turned off.
Any help will be much appreciated.
Thanks
Steve