Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sorting and delete records with macro


Hi, I have a raw data file with very large size, for monthly data file,
it could be up to 20 to 30MB. Inside the files there are a lot of
columns and records that I don't need.

So, I have written a macro that will delete unwanted columns and rows
from the raw data files. When I run the marco, I realise that it is
very slow when the file is getting larger as it will go to the records
line by line to check whether it is wanted record.

For example, if the records contains "ABC", the macro will delete the
that whole record. Is there a way the I can program the macro to sort
the data file and search for the first appeared "ABC" and the last
appeared "ABC", then delete the whole range of the record?

or is there any other better way that can make the process faster?

Please advice..

Thanks a lot..


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Sorting and delete records with macro

Hi there,

Not sure how much speed you might gain this way given the
size of your file, but it's worth giving it a shot,
chances are it will be substantial... filter and delete
the filter selection rather than going line by line.
Also, in either case make sure you set screen updating to
false at the beginning of your code (and resetting to true
at the end) if you have not already done it, it makes a
hell of a difference!

Nikos
-----Original Message-----

Hi, I have a raw data file with very large size, for

monthly data file,
it could be up to 20 to 30MB. Inside the files there are

a lot of
columns and records that I don't need.

So, I have written a macro that will delete unwanted

columns and rows
from the raw data files. When I run the marco, I realise

that it is
very slow when the file is getting larger as it will go

to the records
line by line to check whether it is wanted record.

For example, if the records contains "ABC", the macro

will delete the
that whole record. Is there a way the I can program the

macro to sort
the data file and search for the first appeared "ABC" and

the last
appeared "ABC", then delete the whole range of the record?

or is there any other better way that can make the

process faster?

Please advice..

Thanks a lot..


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

.

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
Delete records when certain records have duplicate column data JVroom New Users to Excel 1 January 26th 09 06:23 PM
delete records with unique value Jenna Excel Discussion (Misc queries) 1 August 21st 06 04:53 PM
Sorting Records reese Excel Discussion (Misc queries) 2 April 7th 05 11:02 PM
Delete records using excel Macro Ken Wright Excel Programming 1 November 3rd 03 08:01 PM
Delete records using excel Macro Nick Hodge[_4_] Excel Programming 0 November 3rd 03 07:31 PM


All times are GMT +1. The time now is 03:58 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"