Question about Macro

%3CLINGO-SUB%20id%3D%22lingo-sub-2452946%22%20slang%3D%22en-US%22%3EQuestion%20about%20Macro%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2452946%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20try%20to%20run%20a%20Macro%20to%20show%20hidden%20name%2C%20but%20it%20gives%20me%20this%20error%20message.%20What%20should%20I%20do%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2452946%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2453016%22%20slang%3D%22en-US%22%3ERe%3A%20Question%20about%20Macro%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2453016%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1080254%22%20target%3D%22_blank%22%3E%40Zacfin%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1)%20The%20code%20is%20in%20the%20worksheet%20module%20of%20T4%3B%20it%20should%20be%20in%20a%20standard%20module%20(the%20kind%20that%20you%20create%20by%20selecting%20Insert%20%26gt%3B%20Module%20in%20the%20Visual%20Basic%20Editor).%3C%2FP%3E%0A%3CP%3E2)%20A%20macro%20should%20begin%20with%20a%20line%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESub%20%3CEM%3Ename_of_the_macro%3C%2FEM%3E()%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ebut%20that%20line%20is%20missing%20from%20your%20code.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hello,

I try to run a Macro to show hidden name, but it gives me this error message. What should I do?

1 Reply

@Zacfin 

1) The code is in the worksheet module of T4; it should be in a standard module (the kind that you create by selecting Insert > Module in the Visual Basic Editor).

2) A macro should begin with a line

 

Sub name_of_the_macro()

 

but that line is missing from your code.