You can automate small as well as heavy tasks with VBA codes.
And do you know with the help of macros, you can break all the limitations of Excel which you think Excel has?
So today, I have listed some of the useful codes examples to help you become more productive in your day to day work.
You can use these codes even if you haven't used VBA before that.
All you have to do just paste these codes in your VBA editor.
These codes will exactly do the same thing which headings are telling you.
For your convenience, please follow these steps to add these codes to your workbook.
Before you use these codes, make sure you have your developer tab on your Excel ribbon to access VB editor.
If you don't have please use these simple steps to activate developer tab.
Once you activate developer tab, you can use below steps to paste a VBA code into VB editor.
Don't Forget: Make sure to download this free PDF checklist where IтАЩve added all these codes (+ two more E-books) for you which you can use to refer them any time in future.
- `Go to your developer tab and click on "Visual Basic".
- On the left side in "Project Window", right click on the name of your workbook and insert a new module.
- Just paste your codes into the module and close it.
- Now, go to your developer tab and click on the macro button.
- It will show you a window with a list of the macros you have in your file. And, you can run a macro from that list.
And now, let's explore these codes.
...a list of top 100 macro codes for VBA beginners
IтАЩve added all the codes into specific categories so you can find your favorite codes quickly.тАЛ
Just read the title and click on it to get the code.
Important: This is my Ultimate Code Vault which I update on monthly basis with new codes. It would be great if you bookmark this page and keep on visiting to new codes every time.
(A) Basic Codes
These VBA codes will help you to perform some basic tasks in a flash which you frequently do in your spreadsheets.
1. Add Serial Numbers
2. Insert Multiple Columns
3. Insert Multiple Rows
4. Auto Fit Columns
5. Auto Fit Rows
6. Remove Text Wrap
7. Unmerge Cells
8. Open Calculator
9. Add Header/Footer Date
10. Custom Header/Footer
(B) Formatting Codes
These VBA codes will help you to format cells and ranges using some specific criteria and conditions.
11. Highlight Duplicates from Selection
12. Highlight the Active Row and Column
13. Highlight Top 10 Values
14. Highlight Named Ranges
15. Highlight Greater than Values
16. Highlight Lower Than Values
17. Highlight Negative Numbers
18. Highlight Specific Text
19. Highlight Cells with Comments
20. Highlight Alternate Rows in the Selection
21. Highlight Cells with Misspelled Words
22. Count/Highlight Cells With Error in the Entire Worksheet
23. Count/Highlight Cells With A Specific In Entire Worksheet
24. Highlight all the Cells in a Worksheet which are Blank but have an Invisible Space
25. Highlight Max Value In The Range
26. Highlight Min Value In The Range
27. Highlight Unique Values
28. Highlight Difference in Columns
29. Highlight Difference in Rows
(C) Printing Codes
These macro codes will help you to automate some printing tasks which can further save you a ton of time.
30. Print Comments
31. Print Narrow Margin
32. Print Selection
33. Print Custom Pages
(D) Worksheet Codes
These macro codes will help you to control and manage worksheets in an easy way and save your a lot of time.
34. Hide all but the Active Worksheet
35. Unhide all Hidden Worksheets
36. Delete all but the Active Worksheet
37. Protect all Worksheets Instantly
38. Resize All Charts in a Worksheet
39. Insert Multiple Worksheets
40. Protect Worksheet
41. Un-Protect Worksheet
42. Sort Worksheets
43. Protect all the Cells With Formulas
44. Delete all Blank Worksheets
45. Unhide all Rows and Columns
46. Save Each Worksheet as a Single PDF
47. Disable Page Breaks
(E) Workbook Codes
These codes will help you to perform workbook level tasks in an easy way and with minimum efforts.
48. Create a Backup of a Current Workbook
49. Close all Workbooks at Once
50. Copy Active Worksheet into a New Workbook
51. Active Workbook in an Email
52. Add Workbook to a Mail Attachment
53. Welcome Message
54. Closing Message
55. Count Open Unsaved Workbooks
(F). Pivot Table Codes
These codes will help you to manage and make some changes in pivot tables in a flash.
56. Hide Pivot Table Subtotals
57. Refresh All Pivot Tables
58. Create a Pivot Table
59. Auto Update Pivot Table Range
60. Disable/Enable Get Pivot Data
(G). Charts Codes
Use these VBA codes to manage charts in Excel and save your lot of time.
61. Change Chart Type
62. Paste Chart as an Image
63. Add Chart Title
(H) Advanced Codes
Some of the codes which you can use to preform advanced task in your spreadsheets.
64. Save Selected Range as a PDF
65. Create a Table of Content
66. Convert Range into an Image
67. Insert a Linked Picture
68. Use Text to Speech
69. Activate Data Entry Form
70. Use Goal Seek
71. VBA Code to Search on Google
(I) Formula Codes
These codes will help you to calculate or get results which often you do with worksheet functions and formulas.
72. Convert all Formulas into Values
73. Remove Spaces from Selected Cells
74. Remove Characters from a String
75. Add Insert Degree Symbol in Excel
76. Reverse Text
77. Activate R1C1 Reference Style
78. Activate A1 Reference Style
79. Insert Time Range
80. Convert Date into Day
81. Convert Date into Year
82. Remove Time from Date
83. Remove Date from Date and Time
84. Convert to Upper Case
85. Convert to Lower Case
86. Convert to Proper Case
87. Convert to Sentence Case
88. Remove a Character from Selection
89. Word Count from Entire Worksheet
90. Remove the Apostrophe from a Number
91. Remove Decimals from Numbers
92. Multiply all the Values by a Number
93. Add a Number in all the Numbers
94. Calculate the Square Root
95. Calculate the Cube Root
96. Add A-Z Alphabets in a Range
97. Convert Roman Numbers into Arabic Numbers
98. Remove Negative Signs
99. Replace Blank Cells with Zeros
100?
Well, I want you to share your favorite macro code which you use everyday to save your time.
Please share with me in the comment section, IтАЩd love to hear from you.
And in the end, I just want to say that some these codes every day to increase my productivity and IтАЩm sure it will also help you in your work.
I hope you have found this list useful. If yes, then please donтАЩt forget to share this list with your friends.
Download Free PDF Copy
Enter your name and email below to get a Free PDF copy directly into your inbox.
Comments
Post a Comment