Delete empty rows if Column range B to n is empty

SteveP1962

New Member
Joined
Jul 26, 2007
Messages
2
I apologise if this topic has been covered before but I just could not find exactly what I require when I searched the message board.

I have a Matrix consisting of 20 Columns and 1000's of Rows.
I am looking for a Macro that will remove all Rows that do not have Data in Columns B through to the nth Column (20 would be enough).

I do have Data in Column A for every row but if there isn't any data across the row in any other column then it is to be deleted.

SP
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
Hi
Paste the following codes in the macro window ( Alt F11)
Code:
Sub rrr()
x = Cells(Rows.Count, 1).End(xlUp).Row
For a = x To 1 Step -1
c = 0
For b = 2 To 20
If Cells(a, b) = "" Then
c = c + 1
If c = 19 Then
Rows(a).EntireRow.Delete
End If
Else
Exit For
End If
Next b
Next a
End Sub
Run the macro. It will delete rows if col B to N are blank
(test it on a sample data)
ravi
 

SteveP1962

New Member
Joined
Jul 26, 2007
Messages
2
Transpose Horizontal to Vertical

Ravi

Thanks just what I needed, one more question

Is possible using a macro to Transpose data from the Horizontal to Vertical?
Repeating the Column A data for every new Row of Data that was Previously in Column B,C,D............. and output to a new worksheet?

---A-----------B--------C----------D
1 Entry_1| EGGS | FISH | POTATOES

to
----A-------------B
1 ENTRY_1 |EGGS|
2 ENTRY_1 |FISH|
3 ENTRY_1 |POTATOES|
 

Forum statistics

Threads
1,181,647
Messages
5,931,207
Members
436,783
Latest member
darkwingduck1

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
Top