Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Conditional delete using saved macro possible ?

Hello all,
Is it possible to creata an AUTO_OPEN such that all rows in the
spread-sheet which satisfy a certain criterir get deleted ? The data is
obviously dynamic. When I used the AUTO_OPEN and created a macro which
deleted the rows (I was manually doing the process and recording the
macro), if the data did not change, it worked fine. If I changed the
data, as in added or removed rows that fulfilled the criteria for
deletion, the thing went haywire - I realized - the deletion was
working only on a range and if the data changed, the range changed, and
this got messed up.


here is the criteria for deletion

Column A can be 2 values - Error or Valid
Coumn B can be multiple values for a country...say US, CA, UK...
Column C can be multiple values for a type...Hardware, Software,
Warranty...

I have set up an auto-filter using the AUTO_OPEN macro for

ErrorIND, COUNTRY, TYPE etc...

So my criteria for deletion is (using values from auto-filter)

ErrorIND = Error
Country = CA
Type = Software

All such rows should be deleted by the macro and nothing else..

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Conditional delete using saved macro possible ?

just adjust your current macro. Assuming no completely blank rows mixed in
with your data

worksheets("sheet1").Range("A1").CurrentRegion.Aut ofilter . . .

If you have blank rows

With Worksheets("sheet1")
set rng =.range(.cells(1,1),.cells(rows.count,1).end(xlup) )
End with
set rng = rng.Resize(,20) ' change 20 to the number of columns
rng.Autofilter . . .

--
Regards,
Tom Ogilvy


--
Regards,
Tom Ogilvy



"Raj." wrote:

Hello all,
Is it possible to creata an AUTO_OPEN such that all rows in the
spread-sheet which satisfy a certain criterir get deleted ? The data is
obviously dynamic. When I used the AUTO_OPEN and created a macro which
deleted the rows (I was manually doing the process and recording the
macro), if the data did not change, it worked fine. If I changed the
data, as in added or removed rows that fulfilled the criteria for
deletion, the thing went haywire - I realized - the deletion was
working only on a range and if the data changed, the range changed, and
this got messed up.


here is the criteria for deletion

Column A can be 2 values - Error or Valid
Coumn B can be multiple values for a country...say US, CA, UK...
Column C can be multiple values for a type...Hardware, Software,
Warranty...

I have set up an auto-filter using the AUTO_OPEN macro for

ErrorIND, COUNTRY, TYPE etc...

So my criteria for deletion is (using values from auto-filter)

ErrorIND = Error
Country = CA
Type = Software

All such rows should be deleted by the macro and nothing else..

Thanks.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i delete a saved rectangle in excel? gltrg1991 Excel Worksheet Functions 3 February 17th 09 01:50 PM
delete conditional formatting via macro mohavv Excel Discussion (Misc queries) 1 August 27th 08 11:57 PM
Delete all macros if workbook is saved with another name Danny Excel Worksheet Functions 4 March 16th 07 09:57 PM
Macro code to delete conditional formatting Bovine Jones Excel Discussion (Misc queries) 5 October 19th 06 08:39 AM
Conditional Delete in Excel using Macro [email protected] Excel Programming 5 April 27th 06 04:53 PM


All times are GMT +1. The time now is 02:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"