Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 06-09-2005, 02:18 PM
dfeld71 dfeld71 is offline
Registered User
 
Join Date: 23 Mar 2005
Posts: 45
dfeld71 is becoming part of the community
creating new sheets based on specific data

Please Register to Remove these Ads

Hello everyone. I need some help, and always seem to find my answers here! I have a spreadsheet with a bunch of different accounts on it. Column F contains a code which determines what group the account belongs in. I need to split the data into separate spreadsheets based on this code. in addition, every code will not be there everytime. How do I write a macro to evaluate column F, and take all accounts with certain codes and move them to a new sheet. Also, how do I stop the macro from erroring out, if one of the codes does not exist? Here is a sample of my spreadsheet:

A B C D E F
EN4590 TX 4/30/2004 544.1 DD MBOEAS-3
EN1155 IL 5/21/2004 503.85 ER MBOAEA-3
DT8455 IL 8/18/2003 165.44 GS MBOAEE-3
EN4590 TX 4/30/2004 544.1 WB MBOQBL-1
EN1155 IL 5/21/2004 503.85 IF MBOCA1-1

in this example, all rows would be split to their own spreadsheet. If there was more than one account with the same code in F, they would go to the same spreadsheet. I do need to hard code the various codes into the Macro, as the spreadsheets will be saved with names relating to those codes, so I need a way to prevent errors if a certain code does not exist. Please help! Thank you!
Reply With Quote
  #2  
Old 06-09-2005, 04:05 PM
Tom Ogilvy
Guest
 
Posts: n/a
Re: creating new sheets based on specific data

This is being answered in the Excel Programming Newsgroup rather than Excel
Forum, so it may not be useful to you, but Ron de Bruin has written sample
code to perform copies such as this. Look at his site

http://www.rondebruin.nl/tips.htm

--
Regards,
Tom Ogilvy

"dfeld71" <dfeld71.1qdfag_1118340318.6291@excelforum-nospam.com> wrote in
message news:dfeld71.1qdfag_1118340318.6291@excelforum-nospam.com...
>
> Hello everyone. I need some help, and always seem to find my answers
> here! I have a spreadsheet with a bunch of different accounts on it.
> Column F contains a code which determines what group the account
> belongs in. I need to split the data into separate spreadsheets based
> on this code. in addition, every code will not be there everytime. How
> do I write a macro to evaluate column F, and take all accounts with
> certain codes and move them to a new sheet. Also, how do I stop the
> macro from erroring out, if one of the codes does not exist? Here is a
> sample of my spreadsheet:
>
> A B C D E F
> EN4590 TX 4/30/2004 544.1 DD MBOEAS-3
> EN1155 IL 5/21/2004 503.85 ER MBOAEA-3
> DT8455 IL 8/18/2003 165.44 GS MBOAEE-3
> EN4590 TX 4/30/2004 544.1 WB MBOQBL-1
> EN1155 IL 5/21/2004 503.85 IF MBOCA1-1
>
> in this example, all rows would be split to their own spreadsheet. If
> there was more than one account with the same code in F, they would go
> to the same spreadsheet. I do need to hard code the various codes into
> the Macro, as the spreadsheets will be saved with names relating to
> those codes, so I need a way to prevent errors if a certain code does
> not exist. Please help! Thank you!
>
>
> --
> dfeld71
> ------------------------------------------------------------------------
> dfeld71's Profile:

http://www.excelforum.com/member.php...o&userid=21452
> View this thread: http://www.excelforum.com/showthread...hreadid=377807
>



Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump