jeffcoleky
Active Member
- Joined
- May 24, 2011
- Messages
- 274
Theoretically this should be easy right?
I have a file with 300 names. It looks something like this (Except MUCH longer):
I need to create a macro that takes the open document and splits the list into multiple files:
An example would be:
List.csv (275 Rows total)
--TURNS INTO--
List1.csv -- 51 Rows of data (including the header)
List2.csv -- 51 Rows of data (including the header)
List3.csv -- 51 Rows of data (including the header)
List4.csv -- 51 Rows of data (including the header)
List5.csv -- 51 Rows of data (including the header)
List6.csv -- The last 26 Rows of data from List.csv (including the header)
To an excel guru i'm sure this would be very easy so hopefully my explanation is clear enough that you agree. ANY help is much appreciated!
I have a file with 300 names. It looks something like this (Except MUCH longer):
Excel 2010 | ||||
---|---|---|---|---|
A | B | |||
1 | Name | |||
2 | Bob | Bob@bogusemail.com | ||
3 | Ryan | Ryan@bogusemail.com | ||
4 | scott | scott@bogusemail.com | ||
5 | Mark | Mark@bogusemail.com | ||
6 | Santo | Santo@bogusemail.com | ||
7 | Marsha | Marsha@bogusemail.com | ||
8 | Sharon | Sharon@bogusemail.com | ||
9 | Daniel | Daniel@bogusemail.com | ||
10 | Jerry | Jerry@bogusemail.com | ||
Sheet1 |
I need to create a macro that takes the open document and splits the list into multiple files:
- Keeping the maximum lines to 50 on each file (51 including A1:B1).
- The new name of the files should be the same as the open document, with a "1" or "2" at the end to show it's split.
- Files should be saved to the same folder as the one that's being used (or pre-set to a path, whichever is easier).
- Cells A1 & B1 Should remain the same throughout each file. They never change: Cell A1 is always "Name" and Cell B1 is always "E-Mail"
An example would be:
List.csv (275 Rows total)
--TURNS INTO--
List1.csv -- 51 Rows of data (including the header)
List2.csv -- 51 Rows of data (including the header)
List3.csv -- 51 Rows of data (including the header)
List4.csv -- 51 Rows of data (including the header)
List5.csv -- 51 Rows of data (including the header)
List6.csv -- The last 26 Rows of data from List.csv (including the header)
To an excel guru i'm sure this would be very easy so hopefully my explanation is clear enough that you agree. ANY help is much appreciated!