ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA CODE Question (https://www.excelbanter.com/excel-programming/272867-vba-code-question.html)

Gary[_5_]

VBA CODE Question
 
I would like to write a code to check a range of cells and
delete that range in that row if they are empty and shift
up the next row in the range. Then go to the next row and
start all over again. I have found examples of deleting
entire rows, however I do not want to do that, just a
range of cells in a row. Can anyone point me in the right
direction? Perhaps some key methods or examples? Thanks
for any input.

Craig Mitchell

VBA CODE Question
 
I won;t tell you how to do this - but I will point you in
the right direction.

Goto tools - Macros -- record new macro.

perform the actions you want to automate and then review
the code created by going to the VBA editor. it won't be
elegant but it should put you on the path.

Its better to discover than to be shown.

Craig Mitchell

-----Original Message-----
I would like to write a code to check a range of cells

and
delete that range in that row if they are empty and

shift
up the next row in the range. Then go to the next row

and
start all over again. I have found examples of deleting
entire rows, however I do not want to do that, just a
range of cells in a row. Can anyone point me in the

right
direction? Perhaps some key methods or examples? Thanks
for any input.
.


Dave Peterson[_3_]

VBA CODE Question
 
Try this when you're recording the macro:

Select your range with the empty cells.
Edit|goto|special
check Blanks
right click on one of the selected cells
Delete|and shift up

Did it do what you wanted?



Gary wrote:

I would like to write a code to check a range of cells and
delete that range in that row if they are empty and shift
up the next row in the range. Then go to the next row and
start all over again. I have found examples of deleting
entire rows, however I do not want to do that, just a
range of cells in a row. Can anyone point me in the right
direction? Perhaps some key methods or examples? Thanks
for any input.


--

Dave Peterson



All times are GMT +1. The time now is 01:27 PM.

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