Personal Macro Workbook

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,751
Office Version
  1. 365
Platform
  1. Windows
I'm curious about the PMW. Why are the codes within all listed twice like:-

PERSONAL.XLSB!HighlightData.HighlightData

Why cant it be simple and more understandable like when you put a module within a file like:-

HighlightData

Or can it be?
 

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.
It's probably because the module and the macro have the same name.
Calling the macro will fail.

Give the module a different name.
 
Upvote 0
But if I give it a different name won't there be 2 descriptions?
 
Upvote 0
Ok I have changed 1 and there is one description. But I have about 60 macros in my PMW it would take ages to change them all! I thought there may be a setting or something I could change or is that just how it is?
 
Upvote 0
Don't change the macro names. Just change the module name.

The actual macros in the modules do not have the "2 descriptions" names, do they?

I hope you don't have 60 modules with only 1 macro per module. If so, you will need to change each module name.
(In the example you provided, can change to something like Highlight_Data)

I don't know if this can be done programmatically - perhaps there's a way.
 
Upvote 0
All my codes are like the example in #1. When you say change the module name thats the one in the left hand pane, not the one with the code beneath? Maybe there's a macro to change them all!!!
 
Upvote 0
Try the macro below to change the module names.
Try it on a test workbook before trying it on your Personal workbook.
First, go to the VBE, click Tools/References... and put a check mark against "Microsoft Visual Basic for Applications Extensibility 5.3"

Code:
Sub ChangeModuleNames()
Dim VBProj As VBIDE.VBProject
Dim VBComp As VBIDE.VBComponent
Set VBProj = ActiveWorkbook.VBProject
For Each VBComp In VBProj.VBComponents
    If VBComp.Name <> "ThisWorkbook" And Left(VBComp.Name, 5) <> "Sheet" Then _
    VBProj.VBComponents(VBComp.Name).Name = VBComp.Name & "_"
Next VBComp
End Sub

Just to be sure I understand the problem, post the actual name of a macro, like Sub name (), and the name of the module it is in.
 
Last edited:
Upvote 0
Just to be sure I understand the problem, post the actual name of a macro, like Sub name (), and the name of the module it is in.


Its like I say in post 1, the module is named Highlightdata and so is the macro Sub Highlightdata()

Using the code you put what would it rename them all too?
 
Upvote 0
Its like I say in post 1, the module is named Highlightdata and so is the macro Sub Highlightdata()

Using the code you put what would it rename them all too?

The macro I posted should rename all the modules from "ModuleName" to ModuleName_"
 
Upvote 0

Forum statistics

Threads
1,216,138
Messages
6,129,099
Members
449,486
Latest member
malcolmlyle

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