Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Breakout groups from one column of data

I thought I posted this hours earlier today but it never showed up???
Anyway, I have one column of data with Depts and Names listed below the
dept. I need to printout one sheet for each dept and associated names.
Remember this is in one column:

Finance
Bob...
Julie...
(18 more names)
Marketing
Joe...
Fred...
Mary...
(9 more names)
Legal
bob...
Henry...
Manufacturing
(140 names)
many more departments with different numbers of names below each one.
thx
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Breakout groups from one column of data

Hi,

Right click your sheet tab, view code and paste the code below in. Add to
the list of departmenst as required. It will put eqach department and names
in a seperate column

Sub NextSheet()
Dim R As Range
Dim V As Variant
Dim S As String
Dim MyColumn As Long
MyColumn = 1
x = 1
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
'Add as required
S = "Finance,Marketing,Legal,Manufacturing"
V = Split(S, ",")
For Each c In Range("A1:A" & lastrow)

If Not IsError(Application.Match(CStr(c.Value), V, 0)) Then
MyColumn = MyColumn + 1
x = 1
Cells(x, MyColumn).Value = c.Value
Else
x = x + 1
Cells(x, MyColumn).Value = c.Value

End If
Next

End Sub

Mike

"Maarkr" wrote:

I thought I posted this hours earlier today but it never showed up???
Anyway, I have one column of data with Depts and Names listed below the
dept. I need to printout one sheet for each dept and associated names.
Remember this is in one column:

Finance
Bob...
Julie...
(18 more names)
Marketing
Joe...
Fred...
Mary...
(9 more names)
Legal
bob...
Henry...
Manufacturing
(140 names)
many more departments with different numbers of names below each one.
thx

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Breakout groups from one column of data

I should have been more specific.. the actual dept names are like "32245***
Fin Dept Anytown USA 00000 ***", with 'Dept' being the common imbedded text
that I can filter for the different dept's, so I need to use like a "*Dept*"
to breakout the depts where you have S =
"Finance,Marketing,Legal,Manufacturing"? I tried "*Dept*" but the syntax is
wrong.

"Mike H" wrote:

Hi,

Right click your sheet tab, view code and paste the code below in. Add to
the list of departmenst as required. It will put eqach department and names
in a seperate column

Sub NextSheet()
Dim R As Range
Dim V As Variant
Dim S As String
Dim MyColumn As Long
MyColumn = 1
x = 1
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
'Add as required
S = "Finance,Marketing,Legal,Manufacturing"
V = Split(S, ",")
For Each c In Range("A1:A" & lastrow)

If Not IsError(Application.Match(CStr(c.Value), V, 0)) Then
MyColumn = MyColumn + 1
x = 1
Cells(x, MyColumn).Value = c.Value
Else
x = x + 1
Cells(x, MyColumn).Value = c.Value

End If
Next

End Sub

Mike

"Maarkr" wrote:

I thought I posted this hours earlier today but it never showed up???
Anyway, I have one column of data with Depts and Names listed below the
dept. I need to printout one sheet for each dept and associated names.
Remember this is in one column:

Finance
Bob...
Julie...
(18 more names)
Marketing
Joe...
Fred...
Mary...
(9 more names)
Legal
bob...
Henry...
Manufacturing
(140 names)
many more departments with different numbers of names below each one.
thx

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
Ranking different groups in one column Marie Bayes Excel Discussion (Misc queries) 13 August 6th 09 06:55 AM
Analysing different groups of data in the same column bananaman Excel Discussion (Misc queries) 1 November 12th 08 10:48 AM
Reference a column to make groups jhicsupt Excel Discussion (Misc queries) 1 June 7th 08 01:27 AM
Excel data breakout Kelly Excel Discussion (Misc queries) 2 September 26th 06 03:28 PM
percentage breakout from list Percentage Breakout of Where Time Goes Excel Discussion (Misc queries) 1 March 11th 05 05:35 PM


All times are GMT +1. The time now is 05:22 AM.

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

About Us

"It's about Microsoft Excel"