

If ws.Name ActiveSheet.Name Then ws.Visible = xlSheetHiddenĮnd Sub Sort Worksheets Alphabetically Using VBA 'This macro will hide all the worksheet except the active sheet If you’re working on a report or dashboard and you want to hide all the worksheet except the one that has the report/dashboard, you can use this macro code. Hide All Worksheets Except the Active Sheet Here is a detailed tutorial on how to use various methods to unhide sheets in Excel. It then changes the visible property of the worksheet to visible. The above code uses a VBA loop (For Each) to go through each worksheets in the workbook. 'This code will unhide all sheets in the workbook Here is the code that will unhide all the worksheets in the workbook. This could take some time in case there are many hidden sheets. If you are working in a workbook that has multiple hidden sheets, you need to unhide these sheets one by one. How to Get Only the Numeric Part from a String in Excel.Change the Letter Case of Selected Cells to Upper Case.Refresh All Pivot Tables in the Workbook.Highlight Alternate Rows in the Selection.Automatically Insert Date & Timestamp in the Adjacent Cell.Insert A Row After Every Other Row in the Selection.Save Workbook With TimeStamp in Its Name.Sort Worksheets Alphabetically Using VBA.Hide All Worksheets Except the Active Sheet.Using the Code from Excel Macro Examples.In case you find any error in the article or the code, please be awesome and let me know.īelow macro examples are covered in this article: These are comments that are ignored while running the code and are placed as notes for self/reader. Note: You will find many instances of an apostrophe (‘) followed by a line or two. Now, let’s get into the useful macro examples that can help you automate work and save time. It will automatically run when the specified action occurs. In case the code is pasted in the worksheet code window, you don’t need to worry about running the code.


Related Tutorial: Different ways to run a macro in Excel. In case you can’t find the developer tab in the ribbon, read this tutorial to learn how to get it.

Here are the steps you need to follow to use the code from any of the examples: Now before I get into the Macro Example and give you the VBA code, let me first show you how to use these example codes. You can bookmark this page for future reference. If you think something should be on the list, just leave a comment. I will keep updating this tutorial with more macro examples. In this massive article, I am going to list some useful Excel macro examples that I need often and keep stashed away in my private vault. While writing an Excel VBA macro code may take some time initially, once it’s done, you can keep it available as a reference and use it whenever you need it next. So it pays to have a collection of useful VBA macro codes that you can have in your back pocket and use it when needed. Also macro recorder has some limitations. However, that code by macro recorder is often full of code that is not really needed. One way of getting the VBA code is to record the macro and take the code it generates. No-code required.Using Excel Macros can speed up work and save you a lot of time. WorkApps Package your entire business program or project into a WorkApp in minutes.Digital asset management Manage and distribute assets, and see how they perform.Resource management Find the best project team and forecast resourcing needs.Intelligent workflows Automate business processes across systems.Governance & administration Configure and manage global controls and settings.Streamlined business apps Build easy-to-navigate business apps in minutes.Integrations Work smarter and more efficiently by sharing information across platforms.Secure request management Streamline requests, process ticketing, and more.Process management at scale Deliver consistent projects and processes at scale.Content management Organize, manage, and review content production.Workflow automation Quickly automate repetitive tasks and processes.Team collaboration Connect everyone on one collaborative platform.Smartsheet platform Learn how the Smartsheet platform for dynamic work offers a robust set of capabilities to empower everyone to manage projects, automate workflows, and rapidly build solutions at scale.
