Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete columns with headings but rows are empty
Hi,
I have data where columns have headings but rows are blank. I have approx 500 rows of data. ID Student Course 1 Course 2 2 Tom 0 3 Suzie Thanks for your assistance |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete columns with headings but rows are empty
-- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Deb" wrote: Hi, I have data where columns have headings but rows are blank. I have approx 500 rows of data. ID Student Course 1 Course 2 2 Tom 0 3 Suzie Thanks for your assistance . |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to delete columns with headings but rows are empty
Deb,
If I understand correctly we loop through columns and if there are no data in the column except for the header row we delete the entire column. If that's correct then try this macro Sub Del_Cols() Dim Col As Long Set sht = Sheets("Sheet1") For Col = sht.UsedRange.Columns.Count To 1 Step -1 If sht.Cells(Rows.Count, Col).End(xlUp).Row = 1 Then Columns(Col).EntireColumn.Delete End If Next End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Deb" wrote: Hi, I have data where columns have headings but rows are blank. I have approx 500 rows of data. ID Student Course 1 Course 2 2 Tom 0 3 Suzie Thanks for your assistance . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hpw do I delete multiple empty rows found between filled rows? | Excel Worksheet Functions | |||
Cut filtered rows, paste into next empty row of new sheet, and delete cut rows | Excel Worksheet Functions | |||
Delete rows that are empty across columns | Excel Worksheet Functions | |||
Delete rows with empty cells in columns B&C | Excel Discussion (Misc queries) | |||
how do i delete the extra empty rows and columns that i dont need. | Excel Discussion (Misc queries) |