Remove Blanks in Column

Mcook13

New Member
Joined
May 14, 2019
Messages
43
I have the following formula in the cells in column S is =IF(Key!AY:AY="NotExist", Key!AZ:AZ,"").

I want to remove the blanks and display just these numbers at the top of column S.


Column S[TABLE="class: grid, width: 200"]
<tbody>[TR]
[TD]4500429658[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]4500429343[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]4500429117[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]4500434998[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
this will delete the entire row if the cell in "S" is blank !


Code:
Sub MM1()
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "S").End(xlUp).Row
    For r = lr To 1 Step -1
        If Range("S" & r).Value = "" Then Rows(r).Delete
    Next r
End Sub
 
Upvote 0
Put this formula in an adjacent column next to first row of your data
Drag down until a blank cell appears as the result
You will need to change the "21" in the formula to whatever the last row of your data is !!

Code:
=IFERROR(INDEX($S:$S,SMALL(INDEX(ISBLANK($S$1:$S$21)*10^10+ROW($S$1:$S$21),0),ROW(S1))),"")
 
Last edited:
Upvote 0
Michael M,

So I did some reading and tried my hand at coding. It didn't work and instead deleted a lot of info. I should of added more detail about my worksheet so you know what I was working with.

I tweaked my sheet so it is more organized and here is what I am trying to do.

I have two columns (columns AZ and BA) on my tab called "Key".

In Column AZ, the cells have either the word "Exist" or "NotExist".

Column BA has a list of part #'s and if they don't appear on separate sheet then in the adjacent cell in Column AZ it will say "NotExist".

I want to display on my main tab called "Orders Dashboard" in column X starting at cell X10, all the orders that were labeled with "NotExist".
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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