Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default selection for output

I have a list with different companies in column A. My problem is I have to
create a report that should only print the name for each company once and
list the staff matched to the company under the company name.

example: A B C D E
F
ACME Jones Sally
MINOR Brown Jack
FLOSS Kahn Shri
DUNKIN Cow Holy
ACME TT KK
ACME JJ BB
MINOR Notes Keys

Report example:
A B C D E F
ACME
TT KK
JJ BB
Jones Sally

DUNKIN
Cow Holy

FLOSS
Kahn Shri

MINOR
Brown Jack
Notes Keys


If anyone can resolve this for me I would greatly appreicate it!



53214920
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default selection for output

The sode below assumes the source sheet is Sheet1 and creates a new worksheet
called report. It then sorts the data to get all the company names in order.
Then formats the data the way you specified.

Sub make_report()

Sheets("Sheet1").Copy _
after:=Sheets(Sheets.Count)
ActiveSheet.Name = "Report"
With Sheets("Report")
.Cells.Sort _
Key1:=Range("A1"), _
Order1:=xlAscending, _
Header:=xlGuess

RowCount = 1
CompanyName = ""
Do While .Range("A" & RowCount) < ""
If .Range("A" & RowCount) < CompanyName Then
CompanyName = .Range("A" & RowCount)
.Rows(RowCount).Insert
.Range("A" & RowCount) = CompanyName
RowCount = RowCount + 1
End If
.Range("A" & RowCount) = ""
RowCount = RowCount + 1
Loop
End With

End Sub


"49niner" wrote:

I have a list with different companies in column A. My problem is I have to
create a report that should only print the name for each company once and
list the staff matched to the company under the company name.

example: A B C D E
F
ACME Jones Sally
MINOR Brown Jack
FLOSS Kahn Shri
DUNKIN Cow Holy
ACME TT KK
ACME JJ BB
MINOR Notes Keys

Report example:
A B C D E F
ACME
TT KK
JJ BB
Jones Sally

DUNKIN
Cow Holy

FLOSS
Kahn Shri

MINOR
Brown Jack
Notes Keys


If anyone can resolve this for me I would greatly appreicate it!



53214920

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
Copy Selection - Paste Selection - Delete Selection Uninvisible Excel Programming 2 October 25th 07 01:31 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Combo Box selection only shows bound column info after selection made. Coby Excel Programming 1 October 18th 07 02:04 AM
Set of varibles produces one output. Need series of output. Bernie Deitrick Excel Programming 1 January 11th 07 12:00 AM
Getting output from an excel output back to cscript.. J S Excel Programming 0 January 21st 04 09:06 PM


All times are GMT +1. The time now is 04:01 PM.

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"