Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Is there an easy way to delete empty columns?

I am using Excel 2007.

I have a spreadsheet that has been exported from an in-house software
database. It has 57 columns and more than 1,000 rows. A lot of the columns
are totally blank. Other than finding them manually is there an easier way
to delete them?
--
Thank you.
Jayne
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Is there an easy way to delete empty columns?

Sub colkiller()
Set r = ActiveSheet.UsedRange
nLastColumn = r.Columns.Count + r.Column - 1
For i = nLastColumn To 1 Step -1
Set rcol = Cells(1, i).EntireColumn
If Application.WorksheetFunction.CountA(rcol) = 0 Then
rcol.Delete Shift:=xlToLeft
End If
Next
End Sub
--
Gary''s Student - gsnu200803


"Acanesfan" wrote:

I am using Excel 2007.

I have a spreadsheet that has been exported from an in-house software
database. It has 57 columns and more than 1,000 rows. A lot of the columns
are totally blank. Other than finding them manually is there an easier way
to delete them?
--
Thank you.
Jayne

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 434
Default Is there an easy way to delete empty columns?

hi, !

I am using Excel 2007.
I have a spreadsheet that has been exported from an in-house software database.
It has 57 columns and more than 1,000 rows. A lot of the columns are totally blank.
Other than finding them manually is there an easier way to delete them?


1) select the entire row (say) of your titles
2) {F5} (button) special... blank cells accept
3) right-click delete... entire column

hth,
hector.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete at once empty columns in a table? capxc Excel Discussion (Misc queries) 1 July 19th 08 08:28 PM
Delete rows that are empty across columns ALATL Excel Worksheet Functions 0 November 6th 06 04:09 AM
How do I delete multiple empty columns in Excel at one time? Cindy C Excel Discussion (Misc queries) 2 October 12th 06 07:09 AM
Delete rows with empty cells in columns B&C Richard Excel Discussion (Misc queries) 3 March 18th 06 12:15 AM
how do i delete the extra empty rows and columns that i dont need. lindaY Excel Discussion (Misc queries) 3 March 20th 05 03:48 PM


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"