Loop with Condition: Check column for empty cells, if empty shiftup data

drmingle

Board Regular
Joined
Oct 5, 2009
Messages
229
I have a list of data within column B. The data is all spread out out in column B.

For example,

B1 = IsEmpty
B2 = ABC
B3 = IsEmpty
B4 = ABC

I would like to run some VBA to basically wipe out all the blank cells for this column only, so that I am only left with cells that have data contained in them.

I only need to search to row 200 (not the whole sheet).

NOTE: I will not be able to delete EntireRow since I have adjacent cells with data.

NOTE: I have used the following without success - Skip Blanks in pasting, F5 GoTo Special Blanks, Set filter to exclude blanks before pasting...

Any help would be appreciated.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
This delete should do what you are asking:

Selection.Delete Shift:=xlUp

This only brings up the cells in whatever column you have selected.

Hope this helps!

Lorelai
 
Upvote 0
Thanks Lorelai:

If someone can help me develop the code to loop through to do the following:

*Find the empty cells contained in a range
*Apply Lorelai's code if the cell is empty

Thanks for the help in advance...

Damian
 
Upvote 0

Forum statistics

Threads
1,216,118
Messages
6,128,939
Members
449,480
Latest member
yesitisasport

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