Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Divide up Worksheet

I have an excel worksheet layed out as follows (numbers = row):

1 - Section Title
2 - Section data 1
3 - Section data 2
4 - Section data 3
etc
20 - blank
21 - Section Title
22 - section data 1
etc

all the different sections are divided by a blank row.
There are no blank rows within each section.
Each section contains a different number of rows.
Each section has multiple columns.

What I want to do is divide this one worksheet in to multipl
worksheets with the same name as the Section Title, and each workshee
only listing the data in its specific section.

Is there a quick and easy way to do this without having to spend age
cutting and pasting

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Divide up Worksheet

Try this (on a sample) et adapt tou your problem
Bye


Sub MakeOnglet2()
Dim rngDelete3 As Range
Dim rng3 As Range
Application.ScreenUpdating = False
Sheets("touslesnoms").Select
Set depart = ActiveSheet
s = ActiveSheet.Name
Range("A2").Activate
With ActiveSheet
For Each rng3 In .Range(.Cells(2, 1), _
.Cells(.Rows.Count, 1).End(xlUp))
egaux = UCase(rng3.Value) = UCase(rng3.Offset(1, 0).Value)
Debug.Print rng3.Address
If egaux Then
If rngDelete3 Is Nothing Then
Set rngDelete3 = rng3.EntireRow
Else
Set rngDelete3 = Union(rngDelete3, rng3)
End If
Else
If rngDelete3 Is Nothing Then
Set rngDelete3 = rng3.EntireRow
Else
Set rngDelete3 = Union(rngDelete3, rng3)
End If
If Not rngDelete3 Is Nothing Then
Worksheets.Add
mname = rng3.Value
ActiveSheet.Name = mname
'target = ActiveWorkbook.Name
ActiveWindow.Zoom = 75
depart.Activate
Rows("1:1").Select
Selection.Copy
Sheets(mname).Activate
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Application.CutCopyMode = False
If Not rngDelete3 Is Nothing Then
Set rng1 = Sheets(mname).Range("A2")
rngDelete3.EntireRow.Copy rng1
End If

'depart.Activate
'Sheets(1).Range("A1").Select
Range("A1").Select
Range("A1:T1").Interior.ColorIndex = 24
ActiveWindow.SplitRow = 1
ActiveWindow.FreezePanes = True
Range("A2").Activate
Range("A1").Select
Set rngDelete3 = Nothing
depart.Activate
End If
End If
Next rng3
End With
Range("A1").Select
End Sub



...Patrick
Quoi que vous fassiez, faites le bien .
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel

"HilcrRWise " a écrit dans le
message de ...
I have an excel worksheet layed out as follows (numbers = row):

1 - Section Title
2 - Section data 1
3 - Section data 2
4 - Section data 3
etc
20 - blank
21 - Section Title
22 - section data 1
etc

all the different sections are divided by a blank row.
There are no blank rows within each section.
Each section contains a different number of rows.
Each section has multiple columns.

What I want to do is divide this one worksheet in to multiple
worksheets with the same name as the Section Title, and each worksheet
only listing the data in its specific section.

Is there a quick and easy way to do this without having to spend ages
cutting and pasting?


---
Message posted from http://www.ExcelForum.com/



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
divide Marc Excel Discussion (Misc queries) 2 September 22nd 06 02:34 AM
How do you divide all values in the worksheet by 1000000 me Excel Worksheet Functions 1 April 25th 05 04:29 AM
divide by 0 sony654 Excel Worksheet Functions 4 April 24th 05 08:10 AM
Divide one row over other row I dont wont to divide one number Rick Excel Discussion (Misc queries) 0 March 4th 05 07:13 PM
Divide Expression stops in Macro when Can't divide JUAN Excel Programming 6 May 6th 04 07:05 AM


All times are GMT +1. The time now is 11:10 AM.

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"