How can I use event`s with a Personal Workbook macros

Eric Penfold

Active Member
Joined
Nov 19, 2021
Messages
431
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I have a situation where I am trying to use a Personal workbook macros but the event is trigged by the current open workbook. How is this possible?

VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)


    If Sh.Name <> "Summary" And Sh.Name <> "Trend" And Sh.Name <> "Supplier BO" And Sh.Name <> "Diff Depot" _
        And Sh.Name <> "BO WO" And Sh.Name <> "Diff Depot" Then
        
        
        If Target.Column = 1 Then
            If Sh.Range("AA1") = "" Then
                Sh.Range("AA1") = 1
                If DoubleClick = True Then
                    Sh.Range("AA1") = ""
                    Exit Sub
                Else
                    
                    Call Group_OrderNos
                    
                    Call Fill_NSI_Cells
                    
                    Call Duplicate_Delete
                    
                    Call Number_To_Text_Macro
                    
                    Call Format_Cells
                    
                End If
            End If
        End If
        
        If Target.Column = 10 Then
            If Sh.Range("AA1") = "" Then
                Sh.Range("AA1") = 1
                Call BO_Drop_DownList
                Call BO_Reason
            End If
        End If
    End If
    
End Sub
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Are you trying to trap the events in one or more other workbooks from within the personal macro workbook, or simply call code that is stored in the personal macro workbook from another workbook's event code?
 
Upvote 0
Are you trying to trap the events in one or more other workbooks from within the personal macro workbook. Yes trying to do this. I would like all macro`s off current workbook onto the
personal workbook will this mean that i could use current workbook as xlsx instead of xlsm?
 
Upvote 0
Yes, it would but why is that important? (the answer may affect whether this approach is going to help you)
 
Upvote 0
Just that i find because the workbooks without the Personal workbooks are far to big and take ages to open, run macros and save. Now that others use them means that they get frustrated by the speed of macros working then stop using the coded workbooks?
 
Last edited:
Upvote 0
If you use code in your personal macro workbook, that won't work for anyone else. Is that going to be an issue?

It sounds to me like you need to rethink your code if it's that slow.
 
Upvote 0
Could they not save the personal book onto their Machine? It`s still worth having a personal workbook for me to save a lot of time. I`ve been through the code to make it faster but it`s still to slow.
 
Upvote 0
Could they not save the personal book onto their Machine? It`s still worth having a personal workbook for me to save a lot of time. I`ve been through the code to make it faster but it`s still to slow.
Alternatives to personal workbooks are addins (xla\xlam) and they are more flexible... I guess addins can be saved in a shared drive so they can be accessed by other users.

Note that placing the code in the personal workbook or in an addin will help you with the size\repetitiveness of the code in the client workbooks as well as with stopping the users from getting frustrated and refusing to use the client workbooks but, I don't think it will help with the slow issue when opening\saving if the workbooks are too heavy.
 
Upvote 0
If the current workbook is to be xlsx then will it save faster?
I am not exactly sure about that... But one thing is sure though is that any big sized workbook will be slower (xlsx, macro enabled or otherwise)
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top