J
jay dean
Hi -
I have data in Range("A:A. All the cells contain data contiguously
(i.e there is/are not empty cells in between).
However, some of the data in some cells are bound to be deleted. I need
a macro that will loop through the range and if there are any empty
cells, the macro will re-arrange the data (by moving them up) so that
empty cells will only be below the last entry.
Example: If the macro sees empty cells somewhere like:
A1:546
A2:908566
A3: <Empty Cell>
A4:57886
A5:43
A6:<Empty Cell>
A7:<Empty Cell>
A8:89432
...
Then the macro will re-arrange by moving the data up as:
A1:546
A2:908566
A3:57886
A4:43
A5:89432
A6:<Empty Cell>
A7:<Empty Cell>
A8:<Empty Cell>
...
SO IN THE END: All empty cells will be BELOW the last entry.I could
easily solve this problem by just looking for empty cells and deleting
the entirerow, but that is not an option, because I will lose data in
other columns of the sheet.
Any help will be appreciated.
Thanks
Jay Dean
*** Sent via Developersdex http://www.developersdex.com ***
I have data in Range("A:A. All the cells contain data contiguously
(i.e there is/are not empty cells in between).
However, some of the data in some cells are bound to be deleted. I need
a macro that will loop through the range and if there are any empty
cells, the macro will re-arrange the data (by moving them up) so that
empty cells will only be below the last entry.
Example: If the macro sees empty cells somewhere like:
A1:546
A2:908566
A3: <Empty Cell>
A4:57886
A5:43
A6:<Empty Cell>
A7:<Empty Cell>
A8:89432
...
Then the macro will re-arrange by moving the data up as:
A1:546
A2:908566
A3:57886
A4:43
A5:89432
A6:<Empty Cell>
A7:<Empty Cell>
A8:<Empty Cell>
...
SO IN THE END: All empty cells will be BELOW the last entry.I could
easily solve this problem by just looking for empty cells and deleting
the entirerow, but that is not an option, because I will lose data in
other columns of the sheet.
Any help will be appreciated.
Thanks
Jay Dean
*** Sent via Developersdex http://www.developersdex.com ***