Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA to sort and paste data

Status
Not open for further replies.

BChumie

Programmer
Jan 11, 2002
130
US
Hello,

I am currently working on a project that takes about 3,000 to 35,000 rows of data (varies depending on the month) and seperates them into worksheet based on a unique identifer. For instance

499 John Combs
499 Dick Elloit
599 Jason Pierce

in one excel spread sheet. I want to copy or move that data so that it is in two worksheets (one for 499 and one for 599). Currently I am doing this but I am constintely activating different excel spread sheets inorder to get that data into them, I am using a loop basically that looks at the id number and copies that row of data from my main sheet to my smaller sheets. As you can probably tell this takes forever with all the information I am copying. My question is, is there a better way to maybe copy all the data at once? (I have sorted the original xl file so that all the id numbers will be together). Or is there a way to not activate the worksheet i want to copy to and from each time I copy one row? Any help would be greatly appreciated.

Thanks,
Brad
 
Brad,

It seems VERY clear (at least to me) that you're a "candidate" for the use of Excel's POWERFUL "database" functions - especially when dealing with a LARGE number of records.

If you would like to send me a copy of your file, with a small number of records, I'll insert an extraction routine and return it. (Replace sensitive data with fictitious data if necessary - but still use data that reflects the type of data you're dealing with)

Hope this helps.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top