ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   delete rows when value is within an interval in col 3 (https://www.excelbanter.com/excel-programming/376014-delete-rows-when-value-within-interval-col-3-a.html)

sverre

delete rows when value is within an interval in col 3
 
Hi

I would like to delete rows in col 3 IF the value in col 3 is in the
interval below:

9999999


<11000000

How do I write that syntax?

Best regards
Sverre


Don Guillett

delete rows when value is within an interval in col 3
 
lr=cells(rows.count,"c").end(xlup).row
for i=2 to lr
if cells(i,"c")999 and cells(i,"c")<1100 then rows(i).delete
next

--
Don Guillett
SalesAid Software

"sverre" wrote in message
...
Hi

I would like to delete rows in col 3 IF the value in col 3 is in the
interval below:

9999999


<11000000

How do I write that syntax?

Best regards
Sverre




sverre

delete rows when value is within an interval in col 3
 
Hi Don

It works only for one line at a time - it does not check all lines. It stops
and you need to repeat the macro.

Any ideas?

Br

"Don Guillett" skrev:

lr=cells(rows.count,"c").end(xlup).row
for i=2 to lr
if cells(i,"c")999 and cells(i,"c")<1100 then rows(i).delete
next

--
Don Guillett
SalesAid Software

"sverre" wrote in message
...
Hi

I would like to delete rows in col 3 IF the value in col 3 is in the
interval below:

9999999


<11000000

How do I write that syntax?

Best regards
Sverre





Don Guillett

delete rows when value is within an interval in col 3
 

I just tested and it worked just fine. What did you do (step by step)

--
Don Guillett
SalesAid Software

"sverre" wrote in message
...
Hi Don

It works only for one line at a time - it does not check all lines. It
stops
and you need to repeat the macro.

Any ideas?

Br

"Don Guillett" skrev:

lr=cells(rows.count,"c").end(xlup).row
for i=2 to lr
if cells(i,"c")999 and cells(i,"c")<1100 then rows(i).delete
next

--
Don Guillett
SalesAid Software

"sverre" wrote in message
...
Hi

I would like to delete rows in col 3 IF the value in col 3 is in the
interval below:

9999999

<11000000

How do I write that syntax?

Best regards
Sverre







sverre

delete rows when value is within an interval in col 3
 
Hi Don

Can I send you a mail with the doc as attach. and you can see what happens?

I think something is wrong with the row count.

Sverre

"Don Guillett" skrev:


I just tested and it worked just fine. What did you do (step by step)

--
Don Guillett
SalesAid Software

"sverre" wrote in message
...
Hi Don

It works only for one line at a time - it does not check all lines. It
stops
and you need to repeat the macro.

Any ideas?

Br

"Don Guillett" skrev:

lr=cells(rows.count,"c").end(xlup).row
for i=2 to lr
if cells(i,"c")999 and cells(i,"c")<1100 then rows(i).delete
next

--
Don Guillett
SalesAid Software

"sverre" wrote in message
...
Hi

I would like to delete rows in col 3 IF the value in col 3 is in the
interval below:

9999999

<11000000

How do I write that syntax?

Best regards
Sverre








Don Guillett

delete rows when value is within an interval in col 3
 
Sure, just send to this address

--
Don Guillett
SalesAid Software

"sverre" wrote in message
...
Hi Don

Can I send you a mail with the doc as attach. and you can see what
happens?

I think something is wrong with the row count.

Sverre

"Don Guillett" skrev:


I just tested and it worked just fine. What did you do (step by step)

--
Don Guillett
SalesAid Software

"sverre" wrote in message
...
Hi Don

It works only for one line at a time - it does not check all lines. It
stops
and you need to repeat the macro.

Any ideas?

Br

"Don Guillett" skrev:

lr=cells(rows.count,"c").end(xlup).row
for i=2 to lr
if cells(i,"c")999 and cells(i,"c")<1100 then rows(i).delete
next

--
Don Guillett
SalesAid Software

"sverre" wrote in message
...
Hi

I would like to delete rows in col 3 IF the value in col 3 is in the
interval below:

9999999

<11000000

How do I write that syntax?

Best regards
Sverre











All times are GMT +1. The time now is 10:41 AM.

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