Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello! I have a very large spreadsheet that I have created a Macro to format
and formulate. I can't seem to find the correct coding to put into the macro to search each and every column and get it to auto delete the column if it is blank (contains no data). Can someone help me with this? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Option Explicit
Sub Testme() dim iCol as long dim Wks as worksheet set wks = worksheets("somenamehere") with wks for icol = .usedrange.columns(.usedrange.columns.count).colum n _ to 1 step -1 if application.counta(.columns(icol)) 0 then 'there's something in that column, skip it else .columns(icol).delete end if next icol end with end sub dkeglor wrote: Hello! I have a very large spreadsheet that I have created a Macro to format and formulate. I can't seem to find the correct coding to put into the macro to search each and every column and get it to auto delete the column if it is blank (contains no data). Can someone help me with this? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Add button to bottom of spreadsheet to delete blank lines auto | Excel Discussion (Misc queries) | |||
Delete rows with certain columns blank | Excel Discussion (Misc queries) | |||
Macro to Delete blank cells | Excel Worksheet Functions | |||
Delete rows that contain blank columns | Excel Worksheet Functions | |||
Delete blank rows Macro | Excel Discussion (Misc queries) |