ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro to Delete blank cells (https://www.excelbanter.com/excel-worksheet-functions/67534-macro-delete-blank-cells.html)

GarToms

Macro to Delete blank cells
 
I have a table of data and i want to delete a block of blank cells within it.

i.e.
A b c d e f g h i
1 x x x x x x x x x
2 x x x x x x x x x
3 x x x...................x
4 x x.......[blank]...x
5 x x...................x
6 x x x x x x x x x
7 x x x x x x x x x

Does anyone know a marco that could select these cells and delete them and the data in column i move to column d. Note there may be some cells that are blank i.e. a5 & b4 that i do not want to delete.

Appreciate any support.

Dave Peterson

Macro to Delete blank cells
 
Record a macro when you select your range (avoid columns A:B???)
then edit|goto|special|Blanks
edit|delete|shift cells to the left
stop recording

And you'll have your code.

GarToms wrote:

I have a table of data and i want to delete a block of blank cells
within it.

i.e.
A b c d e f g h i
1 x x x x x x x x x
2 x x x x x x x x x
3 x x x...................x
4 x x.......[blank]...x
5 x x...................x
6 x x x x x x x x x
7 x x x x x x x x x

Does anyone know a marco that could select these cells and delete them
and the data in column i move to column d. Note there may be some cells
that are blank i.e. a5 & b4 that i do not want to delete.

Appreciate any support.

--
GarToms


--

Dave Peterson


All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com