Excel VBA for deleting blank Rows

Jayblade

New Member
Joined
Mar 22, 2013
Messages
2
Hi,

Could anyone give me guidance on vba code for deleting rows where there is no data, I have about 500 lines of data where a blank may appear several times which I need to delete. I also need the loop to end when 20 blank lines are found as this should be the end of the data.

Much appreciated
 

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.
Just Press F5 on the keyboard click special and then find all blank cells once highlighted look for delete and that will sort your issue out.
 
Upvote 0
Thanks Trevor but I am trying to have something automated as this spreadsheet will be used by others who just require the output data as simple as possible. I have setup a macro button that gets the data in the required format its just it has blank rows in a number of places.

Regards
J
 
Upvote 0
Then all you should need to do is record to do the instructions I mentioned and it will then give this code.

Sub mcrFindBlanks()
'
' mcrFindBlanks Macro
'
'
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.Delete Shift:=xlUp
Range("A1").Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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