How to delete blank cells from a table?

bk307

New Member
Joined
Apr 9, 2015
Messages
7
Office Version
  1. 2016
Platform
  1. Windows
Hello, I'm trying to find a way to delete all blank cells from a table in excel. Each cell is either blank or contains a 3 letter code (example below).

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>[TABLE="class: grid, width: 0"]
<tbody>[TR]
[TD]aaa[/TD]
[TD]ada[/TD]
[TD]bdd[/TD]
[TD]bdg[/TD]
[TD]ger[/TD]
[TD]3r2[/TD]
[/TR]
[TR]
[TD]aaa[/TD]
[TD]bdd[/TD]
[TD][/TD]
[TD]ger[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bbb[/TD]
[TD][/TD]
[TD]bdd[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]aaa[/TD]
[TD][/TD]
[TD][/TD]
[TD]rw3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]aca[/TD]
[TD]drg[/TD]
[TD][/TD]
[TD][/TD]
[TD]geg[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


I would like to remove all of the blank cells to end up with the following:

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>[TABLE="class: grid, width: 0"]
<tbody>[TR]
[TD]aaa[/TD]
[TD]ada[/TD]
[TD]bdd[/TD]
[TD]bdg[/TD]
[TD]ger[/TD]
[TD]3r2[/TD]
[/TR]
[TR]
[TD]aaa[/TD]
[TD]bdd[/TD]
[TD]ger[/TD]
[TD]ger[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]bbb[/TD]
[TD]bdd[/TD]
[TD]bdd[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]aaa[/TD]
[TD]rw3[/TD]
[TD]rw3[/TD]
[TD]rw3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]aca[/TD]
[TD]drg[/TD]
[TD]geg[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

My data set has around 90,000 rows and each row contains between 5 to 25 codes, with blank cells intermixed. I would also like to get all of the distinct codes in this data set.

Anyone have any insights?

Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
How many columns you have?

if not too many, you can do this. (For example you have 5 columns, column A - E)
1. On the first right blank column. Enter this formula to combine them: =A1&B1&C1&D1&E1. Drag it down.
2. Copy and paste as value. Remove formula.
3. Use text to column, fixed width. Separate them by 3 letters each.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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