Delete GAPS in columns

sauvage

New Member
Joined
Dec 20, 2011
Messages
25
To Whom it May Concern,

I have around 2368 rows for in each column and I have around 8 columns and what I need to do is to remove any gaps. I do not know how to attach picture here, but I can explaing it in words.

A1: 0.9
A2:
A3:
A4:
A5: -0.09
A6:
A7: 0.4

Is there a way to eliminate those gaps (A2, A3, A4, A6...) in one go?

I would much appreciate your help as it would save me loads of time.

Kind Regards,

Dim
 
That did work. Never knew it can be so easy. Thank you very much for your help.

Thanks to every one who tried to help I appreciate this.

Actually it worked on small sample and is not working on huge one. It deletes some of the gaps (84 rows) and leaves everything else( more than 2k). It says "No Cells Were Found" when I click OK.

Still need help:confused:
 
Last edited:
Upvote 0

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Press ALT + F11, select Module from the Insert menu, paste in the code. Press ALT + Q, press ALT + F8 then double click btest

It has the same problem it deletes just the top. I think it is something to do with the fact that I have copied this column from my other excel file which had formulas in it whereas I copied as values only.
 
Upvote 0
I originally saw that sauvage could have Data in MULTIPLE Columns so there is the need to test (using a Helper Column) If ALL eight columns are maybe DISPLAYING Blanks although there may be underlying formulas in the cells... Is this actually the case?

Jim
 
Upvote 0
It has the same problem it deletes just the top. I think it is something to do with the fact that I have copied this column from my other excel file which had formulas in it whereas I copied as values only.

Problem here is that a formula returning "" is NOT really blank, it's a Null Text string..

Here's an updated version of Vog's Code to handle that..

Code:
Sub btest()
With Columns("A")
    .Value = .Value
    .SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
End Sub
 
Upvote 0
Sorta like the following (Sample)...
Excel Workbook
D
4TRUE
Sheet1
Excel 2007
Cell Formulas
RangeFormula
D4=NOT(COUNT(A4:C4))
 
Upvote 0
Filter on Column D - TRUE -- Delete ALL
Excel Workbook
ABCD
1Numbers1Numbers2Formula ColHelper Col
2355277.000.78FALSE
3303243.00FALSE
4TRUE
511.001.00FALSE
6277416.001.50FALSE
7183326.001.78FALSE
Sheet1
Excel 2007
Cell Formulas
RangeFormula
C2=B2/A2
C3=IF(B3/A3<1,"",B3/A3)
C4=IF(B3/A3<1,"",B3/A3)
C5=B5/A5
C6=B6/A6
C7=B7/A7
D2=NOT(COUNT(A2:C2))
D3=NOT(COUNT(A3:C3))
D4=NOT(COUNT(A4:C4))
D5=NOT(COUNT(A5:C5))
D6=NOT(COUNT(A6:C6))
D7=NOT(COUNT(A7:C7))
 
Upvote 0
Problem here is that a formula returning "" is NOT really blank, it's a Null Text string..

Here's an updated version of Vog's Code to handle that..

Code:
Sub btest()
With Columns("A")
    .Value = .Value
    .SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End With
End Sub

Yes, it worked well. I have made all adjustments to data. Thank you very much for helping out.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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