Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How can I separate a large spreadsheet into worksheets?

I have a large .CSV spreadsheet that shows all of sales history for the
past 12 months. I would like to separate that data into bottom-tabbed
worksheets. I will end up with about 100 worksheets. Our 10-digit customer
code is the first column in the spreadsheet.

When this report was run once a month, I just cut and pasted the data
into separate worksheets manually. However, now the bosses want to be able
to run this report on demand.

If it would make the problem easier, I could break the data down into
separate spreadsheets wneh I export it from the filePro DBMS system. IE,
acmeco.csv, jonesinc.csv, smith.csv, etc.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default How can I separate a large spreadsheet into worksheets?

Mike,

Import the CSV file into an Excel workbook, then run the macro below.

HTH,
Bernie
MS Excel MVP

Sub ExportSheetsFromDatabase()
'Based on the value in the first column
Dim myCell As Range
Dim mySht As Worksheet
Dim myName As String
Dim myArea As Range

Set myArea = Range("A1").CurrentRegion.Columns(1).Offset(1, 0).Cells

Set myArea = myArea.Resize(myArea.Rows.Count - 1, 1)

For Each myCell In myArea
On Error GoTo NoSheet
myName = Worksheets(myCell.Value).Name
GoTo SheetExists:
NoSheet:
Set mySht = Worksheets.Add
mySht.Name = myCell.Value
With myCell.CurrentRegion
.AutoFilter Field:=1, Criteria1:=myCell.Value
.SpecialCells(xlCellTypeVisible).Copy _
mySht.Range("A1")
mySht.Cells.EntireColumn.AutoFit
.AutoFilter
End With
Resume
SheetExists:
Next myCell
End Sub



"Mike Schwartz" wrote in message
...
I have a large .CSV spreadsheet that shows all of sales history for the
past 12 months. I would like to separate that data into bottom-tabbed
worksheets. I will end up with about 100 worksheets. Our 10-digit customer
code is the first column in the spreadsheet.

When this report was run once a month, I just cut and pasted the data
into separate worksheets manually. However, now the bosses want to be able
to run this report on demand.

If it would make the problem easier, I could break the data down into
separate spreadsheets wneh I export it from the filePro DBMS system. IE,
acmeco.csv, jonesinc.csv, smith.csv, etc.

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,123
Default How can I separate a large spreadsheet into worksheets?

Hi mike

See also
http://www.rondebruin.nl/copy5.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Mike Schwartz" wrote in message ...
I have a large .CSV spreadsheet that shows all of sales history for the
past 12 months. I would like to separate that data into bottom-tabbed
worksheets. I will end up with about 100 worksheets. Our 10-digit customer
code is the first column in the spreadsheet.

When this report was run once a month, I just cut and pasted the data
into separate worksheets manually. However, now the bosses want to be able
to run this report on demand.

If it would make the problem easier, I could break the data down into
separate spreadsheets wneh I export it from the filePro DBMS system. IE,
acmeco.csv, jonesinc.csv, smith.csv, etc.

Thanks!


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How can I separate a large spreadsheet into worksheets?

Cool! This worked perfectly! It even put the header row at the top of
each worksheet!

Where do I send the Pizza Hut Gift Card???

Mike


"Bernie Deitrick" wrote:

Mike,

Import the CSV file into an Excel workbook, then run the macro below.

HTH,
Bernie
MS Excel MVP

Sub ExportSheetsFromDatabase()
'Based on the value in the first column
Dim myCell As Range
Dim mySht As Worksheet
Dim myName As String
Dim myArea As Range

Set myArea = Range("A1").CurrentRegion.Columns(1).Offset(1, 0).Cells

Set myArea = myArea.Resize(myArea.Rows.Count - 1, 1)

For Each myCell In myArea
On Error GoTo NoSheet
myName = Worksheets(myCell.Value).Name
GoTo SheetExists:
NoSheet:
Set mySht = Worksheets.Add
mySht.Name = myCell.Value
With myCell.CurrentRegion
.AutoFilter Field:=1, Criteria1:=myCell.Value
.SpecialCells(xlCellTypeVisible).Copy _
mySht.Range("A1")
mySht.Cells.EntireColumn.AutoFit
.AutoFilter
End With
Resume
SheetExists:
Next myCell
End Sub



"Mike Schwartz" wrote in message
...
I have a large .CSV spreadsheet that shows all of sales history for the
past 12 months. I would like to separate that data into bottom-tabbed
worksheets. I will end up with about 100 worksheets. Our 10-digit customer
code is the first column in the spreadsheet.

When this report was run once a month, I just cut and pasted the data
into separate worksheets manually. However, now the bosses want to be able
to run this report on demand.

If it would make the problem easier, I could break the data down into
separate spreadsheets wneh I export it from the filePro DBMS system. IE,
acmeco.csv, jonesinc.csv, smith.csv, etc.

Thanks!




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How can I separate a large spreadsheet into worksheets?

Thanks! Bernie's macro did the trick, but I'm going to bookmark your
page just in case I need to modify it.

Mike Schwartz

"Ron de Bruin" wrote:

Hi mike

See also
http://www.rondebruin.nl/copy5.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Mike Schwartz" wrote in message ...
I have a large .CSV spreadsheet that shows all of sales history for the
past 12 months. I would like to separate that data into bottom-tabbed
worksheets. I will end up with about 100 worksheets. Our 10-digit customer
code is the first column in the spreadsheet.

When this report was run once a month, I just cut and pasted the data
into separate worksheets manually. However, now the bosses want to be able
to run this report on demand.

If it would make the problem easier, I could break the data down into
separate spreadsheets wneh I export it from the filePro DBMS system. IE,
acmeco.csv, jonesinc.csv, smith.csv, etc.

Thanks!





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default How can I separate a large spreadsheet into worksheets?

Where do I send the Pizza Hut Gift Card???

Getting a "Thanks!" is sufficient...

Thanks,
Bernie


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
spreadsheet is too large clueless Excel Discussion (Misc queries) 2 March 1st 07 06:38 PM
need a large spreadsheet cj Excel Discussion (Misc queries) 6 September 15th 06 08:37 PM
Need to separate large verticle data set into columns with 50 entries cathalog Excel Discussion (Misc queries) 5 March 19th 06 06:26 PM
Save 2 separate data imports in separate worksheets on the same ex Jay Excel Worksheet Functions 1 March 8th 06 01:31 PM
large spreadsheet Ross Excel Worksheet Functions 0 June 22nd 05 11:06 AM


All times are GMT +1. The time now is 08:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"