Useful Excel Macro VBA
Hi Friends, Here in this article, I have tried to consolidate some most useful and more frequently used excel macro with examples. This is part 1 where I have provided 20 Excel Macros related to workbook and worksheets. 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 This macro code will help you to automatically add serial numbers in your Excel sheet. Once you run this macro it will show you an input box where you need to enter max number for the serial numbers and after that, it will insert numbers in the column in a sequence. Sub AddSerialNumbers() Dim i As Integer On Error GoTo Last i = InputBox("Enter Value", "Enter Serial Numbers") For i = 1 To i ActiveCell.Value = i ActiveCell.Offset(1, 0).Activate Next i Last:Exit Sub End Sub 2. Insert Multiple Columns Once you run this macro it will show an input box and you need ...