Posts

Showing posts from 2022

Delete Blank Columns From The Excel

Following VBA Code will delete blank columns by ignoring 1st row (i.e header) in the excel Steps to follow 1. Open New Excel Workbook 2. Press Alt+F11 3 Click Insert-->Modue 4. Copy and paste the below code in the Blank module inserted from above step 3 5. Click on the Save button or press Ctrl+S 6. Save the excel workbook in ".xlsm" OR "Macro-Enabled Workbook" format. How to Use this Macro-Enabled WorkBook 1. Open the Macro-Enabled Workbook (eg: "delete_column.xlsm") 2. Copy-paste the data (including header) which contains blank columns. Note: If your data doesn't have a header row then replace the following line of code If Application.WorksheetFunction.CountA(Rng.Columns(Col).EntireColumn) =0 Then 3. Navigate to View in the Menu Bar 4. Select drop down from the Macros Icon--> View Macros 5. Ensure macro name "DeleteROPBlanks" is selected and macros in selected as (eg: "delete_column.xlsm") 6. Hit Run button 7. You can observ