I’ve seen the threads on this subject that recommend “fiddling with the code” or “calling the code in a subroutine”.
An add-in not only allows you to use a macro from any instance of Excel, but you can also edit your code and add new macros to a common repository from any instance also.
I've got a massive bit of code running that takes 30 mins to run and I have it set so that screen updates set to false while most of the code runs but every now and again I turn it to true and straight back to false.
(I can "trick" it into changing view to the newly active worksheet by inserting a "Msg Box" - but don't want to do that.) This has been a hard one for me to search out answers (because looking up "Screenupdating" and anything else brings up a myriad of answers regarding "how to stop the screen from updating"). Display Alerts = True End Sub Private Sub ADSform Gen() Application.
Sub create ADS() Dim one Form As Object Set Main Wrk Bk = Active Workbook cancel = False 'initialise Call ADSheader Form Show Set Main Wrk Bk = Active Workbook 're-Set Main Wrk Bk after doing "Save As" in previous form Call ADSform Gen Main Wrk Bk. Activate 'Doesn't change view 'Msg Box "Enter antenna information from RFDS" '^^^ Tricks it into refreshing worksheet when active Call ADSinput Form Show Call ADSset Antennas Call ADSpull Data Go To Exit Handler Exit Handler: For Each one Form In User Forms Unload one Form This Workbook. Screen Updating = False 'Returned to True after running sub Main Wrk Bk.
Calculation = xl Calculation Automatic 'to reset all formula calcs before deleting source Main Wrk Bk.
Paste Special Paste:=xl Paste Values, _ Operation:=xl None, Skip Blanks:=False, Transpose:=False Application. To make sure this is efficient going forward, I want to prevent that from happening. Enable Events = False Dim bk As Workbook Dim result As Long Dim a WB As Workbook Dim a WS As Worksheet Set a WB = Active Workbook Set a WS = Active Workbook. Here is currently what my code looks like: Sub find Row() Application. Range For repeat = 1 To 30 For Each cell In r cell. Value Mod 2 = 0) Then ' if i is even, color the cell white cell. Range For repeat = 1 To 30 For Each cell In r cell. Value Mod 2 = 0) Then ' if i is even, color the cell white cell. So I'm creating a library of commonly used macros for excel for my Excel 2011 for Mac. Screen Updating is turned on outside of the procedure.