98.8% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » Macros
Macros
Resolved · 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 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
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Hiding Formulae in the Formula BarIt 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. |