remove multiple blank lines after import

glwbco

New Member
Joined
Jul 31, 2009
Messages
3
How can I remove multiple blank Rows after importing data without choosing 2000 different blank rows individually?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
What are the rules you are looking for?
Can we assume that if Column A is blank, then everything in the row is blank and delete that entire row?
 
Upvote 0
Hi, Try:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG31Jul33
ActiveSheet.Cells.SpecialCells(xlCellTypeBlanks).Rows.Delete
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Yes, the entire row is blank. The row is not needed at all. The txt comes in out of a dos program that has a blank row between rows of data.
 
Upvote 0
Hi, Right click sheet Tab, Select "View Code" , (VB Window Appears)
On VB Tool Bar Click "Insert", "Module", (New window appears.)
Paste entire code in VB Window.
Close VB Window.
Click "Alt + F8", Macro Dialog Box appears.
Select Macro Name you've just Pasted.
On R/H/S of Dialog Box , Click "Run".
Blank Rows should now be Deleted
This Bit of Code will remove All Blank Rows Within Your Data.
Regard Mick
 
Upvote 0

Forum statistics

Threads
1,215,483
Messages
6,125,064
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top