Splitting a text file into individual worksheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a large (8,000 lines) text file that I need to import into Excel. The
thing is that I need to get the file into separate worksheets, based on
department number. The departments change about every 50 lines or so (it's
variable).

I've racked my brain and can't think of a way to do this, other than doing
it manually. Any ideas?
 
Thanks, Ron. Looks like #3 will do what I want.

I'm afraid I have no experience with VBA. Can you point me to step-by-step
instructions on how to use this code?

Thanks again,

Sam.
 
Each department number appears in its own column?

If yes, try importing the data into one worksheet, then try...

Ron de Bruin's EasyFilter addin:
http://www.rondebruin.nl/easyfilter.htm

Code from Debra Dalgleish's site:
http://www.contextures.com/excelfiles.html

Create New Sheets from Filtered List -- uses an Advanced Filter to create
separate sheet of orders for each sales rep visible in a filtered list; macro
automates the filter. AdvFilterRepFiltered.xls 35 kb

Update Sheets from Master -- uses an Advanced Filter to send data from
Master sheet to individual worksheets -- replaces old data with current.
AdvFilterCity.xls 55 kb

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
Ron:

I've been looking through some of the other examples on your site, and I
think your "Create separate sheet for each horizontal PageBreak" code would
be easier. I still have no idea how to use it, but it sure looks like it
would work!

Sam.
 
Never mind...I figured out where to put the code, and the "Create separate
sheet for each horizontal PageBreak" code worked beautifully!

Thanks very much, Ron! You just saved me a ton of time!

Sam.
 
Hi Sam

In which column are the department numbers?
Which row is your header row and in which column start your data
 
Back
Top