B
BSII
I have a spreadsheet with some basic column headers in row 1 and data in some
cells below the headers (range is actually flexible). After I divide up the
data into different worksheets, many of the columns are left blank except for
the headers and I'm looking for a way to search the range (A1-Z60), find the
empty columns, and delete them. For example, I'd want to delete columns "B"
and "D" in the following table as they only have the headers in Row1 with no
data below.
A B C D
1 H1 H2 H3 H4
2 1 2
3 33 44
I have found lots of references to deleting empty rows, but not columns. I
was able to find a way to hide empty column (from one of the great
programmers that post help for us beginners) and this works great, but I have
another macro that formats the header colmun which then unhides the empty
columns, so I really need to just delete them.
Any help would be appreciated.
BSII (Michael Lindauer)
cells below the headers (range is actually flexible). After I divide up the
data into different worksheets, many of the columns are left blank except for
the headers and I'm looking for a way to search the range (A1-Z60), find the
empty columns, and delete them. For example, I'd want to delete columns "B"
and "D" in the following table as they only have the headers in Row1 with no
data below.
A B C D
1 H1 H2 H3 H4
2 1 2
3 33 44
I have found lots of references to deleting empty rows, but not columns. I
was able to find a way to hide empty column (from one of the great
programmers that post help for us beginners) and this works great, but I have
another macro that formats the header colmun which then unhides the empty
columns, so I really need to just delete them.
Any help would be appreciated.
BSII (Michael Lindauer)