delete blank and shift up

excelV

New Member
Joined
Mar 19, 2011
Messages
8
I'm trying to go down every column and delete blanks by pasting up but I think I have an error in my coding. I have a date associated with number so I actually have to shift up two columns for every cell but I think the problem lies with the IsEmpty Cell Function.

If anyone has another way to approach this please reply, thank you.


If IsEmpty(ActiveCell.Select) Then
ActiveCell.Offset(0, -1).Range("A1").Select
Selection.End(xlUp).Select
ActiveCell.Offset(2, -1).Range("A1").Select
ElseIf IsEmpty(Active.Offset(0, 1).Range("A1").Select) Then
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Cut
ActiveCell.Offset(-1, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(-2, 1).Range("A1").Select
ActiveCell.Offset(1, 0).Range("A1").Select

End If
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi
Seems a little odd that you would need to delete and shift up in "every" column.
I would this may cause all sorts of errors.
Maybe you could post a sample of what you have and what you would like as the end result.
Have a look at the 2nd line of my tag for a copy of a free HTML maker. This will allow you to download a sample of your data
 
Upvote 0

Forum statistics

Threads
1,223,711
Messages
6,174,020
Members
452,542
Latest member
Bricklin

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