ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro's (https://www.excelbanter.com/excel-programming/323338-macros.html)

Richard Swart via OfficeKB.com

Macro's
 
I would like to make a macro that enables me to delete specific rows. My
data always has the following properties:
date value
22-1-1970 9
23-1-1970 9
24-1-1970
25-1-1970
26-1-1970 9
27-1-1970 9,06
28-1-1970 9,06
29-1-1970 8,88
30-1-1970 9
31-1-1970
1-2-1970
2-2-1970 9,13
3-2-1970 9,19
4-2-1970 9,19

I now want to delete the cells that are empty (zero) and the corresponding
date cell to its left. so something in the range of: if cell b*=0 then del
b* and its corresponding date in column a. Doing this by hand makes no
sense since this is a data set of over 8000 cells

--
Message posted via http://www.officekb.com

Jim Thomlinson[_3_]

Macro's
 
This might be a silly question but why not just sort by column B and float
all of the blanks to the top or bottom and then delete them?

HTH

"Richard Swart via OfficeKB.com" wrote:

I would like to make a macro that enables me to delete specific rows. My
data always has the following properties:
date value
22-1-1970 9
23-1-1970 9
24-1-1970
25-1-1970
26-1-1970 9
27-1-1970 9,06
28-1-1970 9,06
29-1-1970 8,88
30-1-1970 9
31-1-1970
1-2-1970
2-2-1970 9,13
3-2-1970 9,19
4-2-1970 9,19

I now want to delete the cells that are empty (zero) and the corresponding
date cell to its left. so something in the range of: if cell b*=0 then del
b* and its corresponding date in column a. Doing this by hand makes no
sense since this is a data set of over 8000 cells

--
Message posted via http://www.officekb.com


Ken Wright

Macro's
 
OK, firstly Empty is not necessarily the same as Zero, so I'm going to
assume Empty really means Empty.

Select all of column B. Do Edit / Go To / special / blanks, then Edit /
Delete / Entire row.

You can also use Autofilter to filter on cells equal to 0 or empty or
whichever it is and then use Goto / special / visible cells only, then
Edit / Delete / Entire row.

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 97/00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------

"Richard Swart via OfficeKB.com" wrote in message
...
I would like to make a macro that enables me to delete specific rows. My
data always has the following properties:
date value
22-1-1970 9
23-1-1970 9
24-1-1970
25-1-1970
26-1-1970 9
27-1-1970 9,06
28-1-1970 9,06
29-1-1970 8,88
30-1-1970 9
31-1-1970
1-2-1970
2-2-1970 9,13
3-2-1970 9,19
4-2-1970 9,19

I now want to delete the cells that are empty (zero) and the corresponding
date cell to its left. so something in the range of: if cell b*=0 then del
b* and its corresponding date in column a. Doing this by hand makes no
sense since this is a data set of over 8000 cells

--
Message posted via http://www.officekb.com





All times are GMT +1. The time now is 12:23 PM.

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