PC Review


Reply
Thread Tools Rate Thread

Deleting Rows in Large Table

 
 
T. Jenkins
Guest
Posts: n/a
 
      4th Apr 2008
I'm working with a large data set in Excel, over 38,000 rows. I'm trying to
combine two such sets, then do some pivots, but because the combined table is
too large, I need to eliminate some unecessary data.

My approach so far has been to pull in the first set, then run through each
row to find the rows I can eliminate, then delete each one. In this case,
I'm trying to delete any row with "2007" as the year. Everything seems to be
working, but once the code finds the 2007 rows, it's taking a very long time
to run through the data. I've already turned off screen refresh, and set
calculation mode to manual, but it's still taking a very long time.

When I run though the code step by step, I don't detect any pauses or
problems deleting the rows. It seems to run thorugh process very quickly.

Is there any reason why this should take a long time? Is there a better
approach for doing this?

Thanks,
Todd

 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      4th Apr 2008
You might get better results if you post the code you are currently using to
do the deletions. Otherwise, there is nothing to compare to for determining
if there is a better way.

"T. Jenkins" wrote:

> I'm working with a large data set in Excel, over 38,000 rows. I'm trying to
> combine two such sets, then do some pivots, but because the combined table is
> too large, I need to eliminate some unecessary data.
>
> My approach so far has been to pull in the first set, then run through each
> row to find the rows I can eliminate, then delete each one. In this case,
> I'm trying to delete any row with "2007" as the year. Everything seems to be
> working, but once the code finds the 2007 rows, it's taking a very long time
> to run through the data. I've already turned off screen refresh, and set
> calculation mode to manual, but it's still taking a very long time.
>
> When I run though the code step by step, I don't detect any pauses or
> problems deleting the rows. It seems to run thorugh process very quickly.
>
> Is there any reason why this should take a long time? Is there a better
> approach for doing this?
>
> Thanks,
> Todd
>

 
Reply With Quote
 
T. Jenkins
Guest
Posts: n/a
 
      4th Apr 2008
I may have come up with a solution. I was originally cycling through every
rough, checking for the cell entry, and deleting if it matched my criteria.
I'm now trying to use Autofilter to just select those rows that match my
criteria.

If this doesn't work, I'll reply with a copy of the code.

Thanks,
Todd


"JLGWhiz" wrote:

> You might get better results if you post the code you are currently using to
> do the deletions. Otherwise, there is nothing to compare to for determining
> if there is a better way.
>
> "T. Jenkins" wrote:
>
> > I'm working with a large data set in Excel, over 38,000 rows. I'm trying to
> > combine two such sets, then do some pivots, but because the combined table is
> > too large, I need to eliminate some unecessary data.
> >
> > My approach so far has been to pull in the first set, then run through each
> > row to find the rows I can eliminate, then delete each one. In this case,
> > I'm trying to delete any row with "2007" as the year. Everything seems to be
> > working, but once the code finds the 2007 rows, it's taking a very long time
> > to run through the data. I've already turned off screen refresh, and set
> > calculation mode to manual, but it's still taking a very long time.
> >
> > When I run though the code step by step, I don't detect any pauses or
> > problems deleting the rows. It seems to run thorugh process very quickly.
> >
> > Is there any reason why this should take a long time? Is there a better
> > approach for doing this?
> >
> > Thanks,
> > Todd
> >

 
Reply With Quote
 
Ivyleaf
Guest
Posts: n/a
 
      5th Apr 2008
On Apr 5, 9:08*am, T. Jenkins <TJenk...@discussions.microsoft.com>
wrote:
> I may have come up with a solution. *I was originally cycling through every
> rough, checking for the cell entry, and deleting if it matched my criteria.. *
> I'm now trying to use Autofilter to just select those rows that match my
> criteria.
>
> If this doesn't work, I'll reply with a copy of the code.
>
> Thanks,
> Todd
>
>
>
> "JLGWhiz" wrote:
> > You might get better results if you post the code you are currently using to
> > do the deletions. *Otherwise, there is nothing to compare to for determining
> > if there is a better way.

>
> > "T. Jenkins" wrote:

>
> > > I'm working with a large data set in Excel, over 38,000 rows. *I'm trying to
> > > combine two such sets, then do some pivots, but because the combined table is
> > > too large, I need to eliminate some unecessary data.

>
> > > My approach so far has been to pull in the first set, then run througheach
> > > row to find the rows I can eliminate, then delete each one. *In thiscase,
> > > I'm trying to delete any row with "2007" as the year. *Everything seems to be
> > > working, but once the code finds the 2007 rows, it's taking a very long time
> > > to run through the data. *I've already turned off screen refresh, and set
> > > calculation mode to manual, but it's still taking a very long time. *

>
> > > When I run though the code step by step, I don't detect any pauses or
> > > problems deleting the rows. *It seems to run thorugh process very quickly.

>
> > > Is there any reason why this should take a long time? *Is there a better
> > > approach for doing this?

>
> > > Thanks,
> > > Todd- Hide quoted text -

>
> - Show quoted text -


Hi Todd,

You'd probably want to use AdvancedFilter rather than AutoFilter.

Cheers,
Ivan.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting rows in large database (+20k rows) =?Utf-8?B?bXdhbTQyMw==?= Microsoft Excel Programming 4 9th Aug 2007 01:06 AM
Q: DataView with Table with large number of rows G .Net Microsoft VB .NET 3 14th Dec 2006 04:51 AM
how to determine the number of rows in a large Word table? =?Utf-8?B?Ym9iIGcgaW4gZXNzZXggY3Q=?= Microsoft Word Document Management 5 20th Nov 2006 12:19 PM
After deleting a large table the file size for the db does not de. =?Utf-8?B?U2hvbmFT?= Microsoft Access 2 22nd Feb 2005 04:39 PM
Index out of range error when deleting rows in dataset table with relationships defined between fields in the same table JerryK Microsoft ADO .NET 0 19th Sep 2003 06:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:28 PM.