macros
RH

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Macros

Macros

resolvedResolved · Low Priority · Version 365

David has attended:
Excel Advanced course
Excel Advanced course

Macros

I download a document every day, the content varies but the header row is the same. I have created 9 or 10 separate macros to change certain parts of the header row, add new columns format the sheet and include formulas where necessary. I would now like to combine the macros so that one click does everything at once. I did try google but I cannot see my macros in VBA. I'm stumped

RE: Macros

Hi David,

Thank you for the forum question.

You will need to write a VBA code to do what you want.

In the visual basic editor in Excel in the module where your macros are stored, click under the last macro (under the line End Sub) and type

Sub RunAll and press Enter. This will give you:

Sub RunAll()

End Sub

Between RunAll() an the line End Sub type the name of the macros in the order you want to execute them. If you for example have macros with the name ChangeHeader, FormatText, AddColumns, the code should look like this


Sub RunAll()
ChangeHeader
FormatText
AddColumns

End Sub

Then by running the RunAll macro you will run all the macros listed inside the RunAll macro.

I hope this makes sense.




Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Hiding Formulae in the Formula Bar

It is possible to protect the contents of a cell reference(s) from amendment by applying cell protection. The contents of the cell reference can also be stopped from displaying in the formula bar.

Step 1: Select Format > Cells > Protection.

Step 2: Tick Hidden option. Ensure Locked is ticked

Step 3: Select Tools > Protection > Protect Sheet

(Ensure "Protect worksheet and contents of locked cells" is ticked)


View all Excel hints and tips


Server loaded in 0.05 secs.