Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Macro to pull data with criterea for placement on a new sheet

I have a worksheet with 2 colums. The rating column will contain 1 of 9
scores. There are about 50 data lines. I need to goup them by that score in
a new worksheet in a block format. I added the example and look of finished
product I need. Can a macro or Excel function make this work?

Data Worksheet:
Rating Name
1A Smith
1A Jerry
2A Jones
3A Daye
1B Wilson
2B Johnson
2B Wint
3B Lager
1C Swith
2C Jackson
3C Cole


Output Worksheet
__________________________________________________ ________________
|All 1C listed here | All 1B listed here | All
1A listed here |
| Swith | Wilson |
Smith |
| | |
Jerry |
|__________________|______________________|_______ ________________|
|All 2C listed here | All 2B listed here | All
2A listed here |
| Jackson | Johnson |
Jones |
| | Wint |
|
|__________________|______________________|_______ ________________|
|All 3C listed here | All 3B listed here | All
3A listed here |
| Cole | Lager |
Daye |
|__________________|______________________|_______ ________________|
--
Trina
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default Macro to pull data with criterea for placement on a new sheet

Trina
A Pivot Table might work for you. Look it up in Help. If not, the
following macro will do it for you. I chose "Sheet2" as the name of the
second or destination sheet. The sheet that holds the original 2 columns (A
& B in this macro) must be the active sheet when you run this macro. Look
at the Select Case part of the macro. The letters that follow the word
Case are your ratings. Type in your ratings in place of what I have. The
numbers following TheCol= are the column numbers in the second sheet in
which the macro will place the names. A 1 is Column A, a 2 is Column B, and
so on. HTH Otto
Sub ShuffleData()
Dim rColB As Range
Dim i As Range
Dim TheCol As Long
Set rColB = Range("B2", Range("B" & Rows.Count).End(xlUp))
For Each i In rColB
Select Case i.Offset(, -1).Value
Case "A": TheCol = 1
Case "B": TheCol = 2
Case "C": TheCol = 3
Case "D": TheCol = 4
Case "E": TheCol = 5
Case "F": TheCol = 6
Case "G": TheCol = 7
Case "H": TheCol = 8
Case "I": TheCol = 9
End Select
With Sheets("Sheet2")
.Cells(Rows.Count, TheCol).End(xlUp).Offset(1).Value =
i.Value
End With
Next i
End Sub
"Trina" wrote in message
...
I have a worksheet with 2 colums. The rating column will contain 1 of 9
scores. There are about 50 data lines. I need to goup them by that score
in
a new worksheet in a block format. I added the example and look of
finished
product I need. Can a macro or Excel function make this work?

Data Worksheet:
Rating Name
1A Smith
1A Jerry
2A Jones
3A Daye
1B Wilson
2B Johnson
2B Wint
3B Lager
1C Swith
2C Jackson
3C Cole


Output Worksheet
__________________________________________________ ________________
|All 1C listed here | All 1B listed here |
All
1A listed here |
| Swith | Wilson |
Smith |
| | |
Jerry |
|__________________|______________________|_______ ________________|
|All 2C listed here | All 2B listed here |
All
2A listed here |
| Jackson | Johnson |
Jones |
| | Wint |
|
|__________________|______________________|_______ ________________|
|All 3C listed here | All 3B listed here | All
3A listed here |
| Cole | Lager |
Daye |
|__________________|______________________|_______ ________________|
--
Trina



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Macro to pull data with criterea for placement on a new sheet

WOW! This is GREAT. I was able to make it work. I wanted to see if I
chould designate the Select Case locations to be a specifc column and row and
not sure how to modify the code. Can that be done?
--
Trina


"Otto Moehrbach" wrote:

Trina
A Pivot Table might work for you. Look it up in Help. If not, the
following macro will do it for you. I chose "Sheet2" as the name of the
second or destination sheet. The sheet that holds the original 2 columns (A
& B in this macro) must be the active sheet when you run this macro. Look
at the Select Case part of the macro. The letters that follow the word
Case are your ratings. Type in your ratings in place of what I have. The
numbers following TheCol= are the column numbers in the second sheet in
which the macro will place the names. A 1 is Column A, a 2 is Column B, and
so on. HTH Otto
Sub ShuffleData()
Dim rColB As Range
Dim i As Range
Dim TheCol As Long
Set rColB = Range("B2", Range("B" & Rows.Count).End(xlUp))
For Each i In rColB
Select Case i.Offset(, -1).Value
Case "A": TheCol = 1
Case "B": TheCol = 2
Case "C": TheCol = 3
Case "D": TheCol = 4
Case "E": TheCol = 5
Case "F": TheCol = 6
Case "G": TheCol = 7
Case "H": TheCol = 8
Case "I": TheCol = 9
End Select
With Sheets("Sheet2")
.Cells(Rows.Count, TheCol).End(xlUp).Offset(1).Value =
i.Value
End With
Next i
End Sub
"Trina" wrote in message
...
I have a worksheet with 2 colums. The rating column will contain 1 of 9
scores. There are about 50 data lines. I need to goup them by that score
in
a new worksheet in a block format. I added the example and look of
finished
product I need. Can a macro or Excel function make this work?

Data Worksheet:
Rating Name
1A Smith
1A Jerry
2A Jones
3A Daye
1B Wilson
2B Johnson
2B Wint
3B Lager
1C Swith
2C Jackson
3C Cole


Output Worksheet
__________________________________________________ ________________
|All 1C listed here | All 1B listed here |
All
1A listed here |
| Swith | Wilson |
Smith |
| | |
Jerry |
|__________________|______________________|_______ ________________|
|All 2C listed here | All 2B listed here |
All
2A listed here |
| Jackson | Johnson |
Jones |
| | Wint |
|
|__________________|______________________|_______ ________________|
|All 3C listed here | All 3B listed here | All
3A listed here |
| Cole | Lager |
Daye |
|__________________|______________________|_______ ________________|
--
Trina




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default Macro to pull data with criterea for placement on a new sheet

Trina
As written you can change the destination column, but the destination
row will always be the next empty row in whatever column it goes into. Tell
me more about what you want when you say "a specific column and row". Give
me a couple of examples. Specifically, tell me how you would determine what
column and row you want as the destination. Otto
"Trina" wrote in message
...
WOW! This is GREAT. I was able to make it work. I wanted to see if I
chould designate the Select Case locations to be a specifc column and row
and
not sure how to modify the code. Can that be done?
--
Trina


"Otto Moehrbach" wrote:

Trina
A Pivot Table might work for you. Look it up in Help. If not, the
following macro will do it for you. I chose "Sheet2" as the name of the
second or destination sheet. The sheet that holds the original 2 columns
(A
& B in this macro) must be the active sheet when you run this macro.
Look
at the Select Case part of the macro. The letters that follow the word
Case are your ratings. Type in your ratings in place of what I have.
The
numbers following TheCol= are the column numbers in the second sheet in
which the macro will place the names. A 1 is Column A, a 2 is Column B,
and
so on. HTH Otto
Sub ShuffleData()
Dim rColB As Range
Dim i As Range
Dim TheCol As Long
Set rColB = Range("B2", Range("B" & Rows.Count).End(xlUp))
For Each i In rColB
Select Case i.Offset(, -1).Value
Case "A": TheCol = 1
Case "B": TheCol = 2
Case "C": TheCol = 3
Case "D": TheCol = 4
Case "E": TheCol = 5
Case "F": TheCol = 6
Case "G": TheCol = 7
Case "H": TheCol = 8
Case "I": TheCol = 9
End Select
With Sheets("Sheet2")
.Cells(Rows.Count, TheCol).End(xlUp).Offset(1).Value =
i.Value
End With
Next i
End Sub
"Trina" wrote in message
...
I have a worksheet with 2 colums. The rating column will contain 1 of 9
scores. There are about 50 data lines. I need to goup them by that
score
in
a new worksheet in a block format. I added the example and look of
finished
product I need. Can a macro or Excel function make this work?

Data Worksheet:
Rating Name
1A Smith
1A Jerry
2A Jones
3A Daye
1B Wilson
2B Johnson
2B Wint
3B Lager
1C Swith
2C Jackson
3C Cole


Output Worksheet
__________________________________________________ ________________
|All 1C listed here | All 1B listed here |
All
1A listed here |
| Swith | Wilson |
Smith |
| |
|
Jerry |
|__________________|______________________|_______ ________________|
|All 2C listed here | All 2B listed here |
All
2A listed here |
| Jackson | Johnson |
Jones |
| | Wint |
|
|__________________|______________________|_______ ________________|
|All 3C listed here | All 3B listed here |
All
3A listed here |
| Cole | Lager |
Daye |
|__________________|______________________|_______ ________________|
--
Trina






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Macro to pull data with criterea for placement on a new sheet

I need the end data to be in a 3 x 3 grid:

1C Data 1B Data 1A Data

2C Data 2B Data 2A Data

2C Data 2B Data 2A Data




--
Trina


"Otto Moehrbach" wrote:

Trina
As written you can change the destination column, but the destination
row will always be the next empty row in whatever column it goes into. Tell
me more about what you want when you say "a specific column and row". Give
me a couple of examples. Specifically, tell me how you would determine what
column and row you want as the destination. Otto
"Trina" wrote in message
...
WOW! This is GREAT. I was able to make it work. I wanted to see if I
chould designate the Select Case locations to be a specifc column and row
and
not sure how to modify the code. Can that be done?
--
Trina


"Otto Moehrbach" wrote:

Trina
A Pivot Table might work for you. Look it up in Help. If not, the
following macro will do it for you. I chose "Sheet2" as the name of the
second or destination sheet. The sheet that holds the original 2 columns
(A
& B in this macro) must be the active sheet when you run this macro.
Look
at the Select Case part of the macro. The letters that follow the word
Case are your ratings. Type in your ratings in place of what I have.
The
numbers following TheCol= are the column numbers in the second sheet in
which the macro will place the names. A 1 is Column A, a 2 is Column B,
and
so on. HTH Otto
Sub ShuffleData()
Dim rColB As Range
Dim i As Range
Dim TheCol As Long
Set rColB = Range("B2", Range("B" & Rows.Count).End(xlUp))
For Each i In rColB
Select Case i.Offset(, -1).Value
Case "A": TheCol = 1
Case "B": TheCol = 2
Case "C": TheCol = 3
Case "D": TheCol = 4
Case "E": TheCol = 5
Case "F": TheCol = 6
Case "G": TheCol = 7
Case "H": TheCol = 8
Case "I": TheCol = 9
End Select
With Sheets("Sheet2")
.Cells(Rows.Count, TheCol).End(xlUp).Offset(1).Value =
i.Value
End With
Next i
End Sub
"Trina" wrote in message
...
I have a worksheet with 2 colums. The rating column will contain 1 of 9
scores. There are about 50 data lines. I need to goup them by that
score
in
a new worksheet in a block format. I added the example and look of
finished
product I need. Can a macro or Excel function make this work?

Data Worksheet:
Rating Name
1A Smith
1A Jerry
2A Jones
3A Daye
1B Wilson
2B Johnson
2B Wint
3B Lager
1C Swith
2C Jackson
3C Cole


Output Worksheet
__________________________________________________ ________________
|All 1C listed here | All 1B listed here |
All
1A listed here |
| Swith | Wilson |
Smith |
| |
|
Jerry |
|__________________|______________________|_______ ________________|
|All 2C listed here | All 2B listed here |
All
2A listed here |
| Jackson | Johnson |
Jones |
| | Wint |
|
|__________________|______________________|_______ ________________|
|All 3C listed here | All 3B listed here |
All
3A listed here |
| Cole | Lager |
Daye |
|__________________|______________________|_______ ________________|
--
Trina








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default Macro to pull data with criterea for placement on a new sheet

Trina
I understand the 3x3 grid since there are only 9 ratings. What I don't
know is how many rows do you want to reserve in each rating. To be more
exact, how many rows in the top 3 ratings and how many rows in the second 3
ratings. Or maybe you want the code to figure that out. In that case, do
you want any blank rows (how many?) between the upper 3 and the middle 3 and
the lower 3? Otto
"Trina" wrote in message
...
I need the end data to be in a 3 x 3 grid:

1C Data 1B Data 1A Data

2C Data 2B Data 2A Data

2C Data 2B Data 2A Data




--
Trina


"Otto Moehrbach" wrote:

Trina
As written you can change the destination column, but the destination
row will always be the next empty row in whatever column it goes into.
Tell
me more about what you want when you say "a specific column and row".
Give
me a couple of examples. Specifically, tell me how you would determine
what
column and row you want as the destination. Otto
"Trina" wrote in message
...
WOW! This is GREAT. I was able to make it work. I wanted to see if I
chould designate the Select Case locations to be a specifc column and
row
and
not sure how to modify the code. Can that be done?
--
Trina


"Otto Moehrbach" wrote:

Trina
A Pivot Table might work for you. Look it up in Help. If not,
the
following macro will do it for you. I chose "Sheet2" as the name of
the
second or destination sheet. The sheet that holds the original 2
columns
(A
& B in this macro) must be the active sheet when you run this macro.
Look
at the Select Case part of the macro. The letters that follow the
word
Case are your ratings. Type in your ratings in place of what I have.
The
numbers following TheCol= are the column numbers in the second sheet
in
which the macro will place the names. A 1 is Column A, a 2 is Column
B,
and
so on. HTH Otto
Sub ShuffleData()
Dim rColB As Range
Dim i As Range
Dim TheCol As Long
Set rColB = Range("B2", Range("B" & Rows.Count).End(xlUp))
For Each i In rColB
Select Case i.Offset(, -1).Value
Case "A": TheCol = 1
Case "B": TheCol = 2
Case "C": TheCol = 3
Case "D": TheCol = 4
Case "E": TheCol = 5
Case "F": TheCol = 6
Case "G": TheCol = 7
Case "H": TheCol = 8
Case "I": TheCol = 9
End Select
With Sheets("Sheet2")
.Cells(Rows.Count, TheCol).End(xlUp).Offset(1).Value
=
i.Value
End With
Next i
End Sub
"Trina" wrote in message
...
I have a worksheet with 2 colums. The rating column will contain 1
of 9
scores. There are about 50 data lines. I need to goup them by that
score
in
a new worksheet in a block format. I added the example and look of
finished
product I need. Can a macro or Excel function make this work?

Data Worksheet:
Rating Name
1A Smith
1A Jerry
2A Jones
3A Daye
1B Wilson
2B Johnson
2B Wint
3B Lager
1C Swith
2C Jackson
3C Cole


Output Worksheet
__________________________________________________ ________________
|All 1C listed here | All 1B listed here |
All
1A listed here |
| Swith | Wilson |
Smith |
| |
|
Jerry |
|__________________|______________________|_______ ________________|
|All 2C listed here | All 2B listed here |
All
2A listed here |
| Jackson | Johnson |
Jones |
| | Wint
|
|
|__________________|______________________|_______ ________________|
|All 3C listed here | All 3B listed here |
All
3A listed here |
| Cole | Lager |
Daye |
|__________________|______________________|_______ ________________|
--
Trina








  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Macro to pull data with criterea for placement on a new sheet

I would like the code to figure out how many rows will be needed. Ideally, I
would like 3 blank rows in between the top & middle and middle & bottom.

Thanks for all your help!!
--
Trina


"Otto Moehrbach" wrote:

Trina
I understand the 3x3 grid since there are only 9 ratings. What I don't
know is how many rows do you want to reserve in each rating. To be more
exact, how many rows in the top 3 ratings and how many rows in the second 3
ratings. Or maybe you want the code to figure that out. In that case, do
you want any blank rows (how many?) between the upper 3 and the middle 3 and
the lower 3? Otto
"Trina" wrote in message
...
I need the end data to be in a 3 x 3 grid:

1C Data 1B Data 1A Data

2C Data 2B Data 2A Data

2C Data 2B Data 2A Data




--
Trina


"Otto Moehrbach" wrote:

Trina
As written you can change the destination column, but the destination
row will always be the next empty row in whatever column it goes into.
Tell
me more about what you want when you say "a specific column and row".
Give
me a couple of examples. Specifically, tell me how you would determine
what
column and row you want as the destination. Otto
"Trina" wrote in message
...
WOW! This is GREAT. I was able to make it work. I wanted to see if I
chould designate the Select Case locations to be a specifc column and
row
and
not sure how to modify the code. Can that be done?
--
Trina


"Otto Moehrbach" wrote:

Trina
A Pivot Table might work for you. Look it up in Help. If not,
the
following macro will do it for you. I chose "Sheet2" as the name of
the
second or destination sheet. The sheet that holds the original 2
columns
(A
& B in this macro) must be the active sheet when you run this macro.
Look
at the Select Case part of the macro. The letters that follow the
word
Case are your ratings. Type in your ratings in place of what I have.
The
numbers following TheCol= are the column numbers in the second sheet
in
which the macro will place the names. A 1 is Column A, a 2 is Column
B,
and
so on. HTH Otto
Sub ShuffleData()
Dim rColB As Range
Dim i As Range
Dim TheCol As Long
Set rColB = Range("B2", Range("B" & Rows.Count).End(xlUp))
For Each i In rColB
Select Case i.Offset(, -1).Value
Case "A": TheCol = 1
Case "B": TheCol = 2
Case "C": TheCol = 3
Case "D": TheCol = 4
Case "E": TheCol = 5
Case "F": TheCol = 6
Case "G": TheCol = 7
Case "H": TheCol = 8
Case "I": TheCol = 9
End Select
With Sheets("Sheet2")
.Cells(Rows.Count, TheCol).End(xlUp).Offset(1).Value
=
i.Value
End With
Next i
End Sub
"Trina" wrote in message
...
I have a worksheet with 2 colums. The rating column will contain 1
of 9
scores. There are about 50 data lines. I need to goup them by that
score
in
a new worksheet in a block format. I added the example and look of
finished
product I need. Can a macro or Excel function make this work?

Data Worksheet:
Rating Name
1A Smith
1A Jerry
2A Jones
3A Daye
1B Wilson
2B Johnson
2B Wint
3B Lager
1C Swith
2C Jackson
3C Cole


Output Worksheet
__________________________________________________ ________________
|All 1C listed here | All 1B listed here |
All
1A listed here |
| Swith | Wilson |
Smith |
| |
|
Jerry |
|__________________|______________________|_______ ________________|
|All 2C listed here | All 2B listed here |
All
2A listed here |
| Jackson | Johnson |
Jones |
| | Wint
|
|
|__________________|______________________|_______ ________________|
|All 3C listed here | All 3B listed here |
All
3A listed here |
| Cole | Lager |
Daye |
|__________________|______________________|_______ ________________|
--
Trina









  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default Macro to pull data with criterea for placement on a new sheet

Trina

Here it is. I chose "New Sheet" as the name of the destination
sheet. That name is in the code. Go into the code and find that name (it's
in only one place) and change it to match what you have.

IMPORTANT: This code will clear EVERY cell in the "New Sheet" sheet before
it copies the data to it. If you have data in that sheet that you want to
keep, let me know where it is and I'll change the code accordingly. The
macro will place the data and headers in the destination sheet as you stated
in your last post.

This macro will paste the data into Columns A:C starting in row 1.

This macro assumes your data in the first sheet is in columns A:B starting
in row 2 with headers in row 1.

If you run into errors, they may be because of line wrapping in this post.
The code will not tolerate line wrapping. If you wish, send me an email and
I'll send you the small file I used to develop the code. It will have the
code properly placed. My email address is .
Remove the "extra" from this address. Otto

Sub ShuffleData2()
Dim rColA As Range, Rating As Variant, Dest As Range
Dim rColACopy As Range
Dim rFirst1C As Range, rFirst2C As Range, rFirst3C As Range
Dim NumRow1 As Long, NumRow2 As Long
Set rColA = Range("A1", Range("A" & Rows.Count).End(xlUp))
NumRow1 = Application.Max(Application.CountIf(rColA, "1C"), _
Application.CountIf(rColA, "1B"), Application.CountIf(rColA,
"1A"))
NumRow2 = Application.Max(Application.CountIf(rColA, "2C"), _
Application.CountIf(rColA, "2B"), Application.CountIf(rColA,
"2A"))
With Sheets("New Sheet")
.Cells.ClearContents
Set rFirst1C = .Range("A2")
Set rFirst2C = rFirst1C.Offset(NumRow1 + 4)
Set rFirst3C = rFirst2C.Offset(NumRow2 + 4)
.Range("A1").Value = "1C Data"
.Range("B1").Value = "1B Data"
.Range("C1").Value = "1A Data"
rFirst2C.Offset(-1) = "2C Data"
rFirst2C.Offset(-1, 1) = "2B Data"
rFirst2C.Offset(-1, 2) = "2A Data"
rFirst3C.Offset(-1) = "3C Data"
rFirst3C.Offset(-1, 1) = "3B Data"
rFirst3C.Offset(-1, 2) = "3A Data"
Set rColACopy = Range(rColA(2), rColA(rColA.Count))
Application.ScreenUpdating = False
For Each Rating In Array("1A", "1B", "1C", "2A", "2B", "2C",
"3A", "3B", "3C")
Select Case Rating
Case "1A": Set Dest = rFirst1C.Offset(, 2)
Case "1B": Set Dest = rFirst1C.Offset(, 1)
Case "1C": Set Dest = rFirst1C
Case "2A": Set Dest = rFirst2C.Offset(, 2)
Case "2B": Set Dest = rFirst2C.Offset(, 1)
Case "2C": Set Dest = rFirst2C
Case "3A": Set Dest = rFirst3C.Offset(, 2)
Case "3B": Set Dest = rFirst3C.Offset(, 1)
Case "3C": Set Dest = rFirst3C
End Select
If Not rColACopy.Find(What:=Rating, LookAt:=xlWhole) Is
Nothing Then
rColA.Resize(, 2).AutoFilter
rColA.Resize(, 2).AutoFilter Field:=1,
Criteria1:=Rating
rColACopy.Offset(,
1).SpecialCells(xlCellTypeVisible).Copy Dest
rColA.Resize(, 2).AutoFilter
End If
Next Rating
Application.ScreenUpdating = True
End With
End Sub


"Trina" wrote in message
...
I would like the code to figure out how many rows will be needed. Ideally,
I
would like 3 blank rows in between the top & middle and middle & bottom.

Thanks for all your help!!
--
Trina


"Otto Moehrbach" wrote:

Trina
I understand the 3x3 grid since there are only 9 ratings. What I
don't
know is how many rows do you want to reserve in each rating. To be more
exact, how many rows in the top 3 ratings and how many rows in the second
3
ratings. Or maybe you want the code to figure that out. In that case,
do
you want any blank rows (how many?) between the upper 3 and the middle 3
and
the lower 3? Otto
"Trina" wrote in message
...
I need the end data to be in a 3 x 3 grid:

1C Data 1B Data 1A Data

2C Data 2B Data 2A Data

2C Data 2B Data 2A Data




--
Trina


"Otto Moehrbach" wrote:

Trina
As written you can change the destination column, but the
destination
row will always be the next empty row in whatever column it goes into.
Tell
me more about what you want when you say "a specific column and row".
Give
me a couple of examples. Specifically, tell me how you would
determine
what
column and row you want as the destination. Otto
"Trina" wrote in message
...
WOW! This is GREAT. I was able to make it work. I wanted to see
if I
chould designate the Select Case locations to be a specifc column
and
row
and
not sure how to modify the code. Can that be done?
--
Trina


"Otto Moehrbach" wrote:

Trina
A Pivot Table might work for you. Look it up in Help. If not,
the
following macro will do it for you. I chose "Sheet2" as the name
of
the
second or destination sheet. The sheet that holds the original 2
columns
(A
& B in this macro) must be the active sheet when you run this
macro.
Look
at the Select Case part of the macro. The letters that follow the
word
Case are your ratings. Type in your ratings in place of what I
have.
The
numbers following TheCol= are the column numbers in the second
sheet
in
which the macro will place the names. A 1 is Column A, a 2 is
Column
B,
and
so on. HTH Otto
Sub ShuffleData()
Dim rColB As Range
Dim i As Range
Dim TheCol As Long
Set rColB = Range("B2", Range("B" & Rows.Count).End(xlUp))
For Each i In rColB
Select Case i.Offset(, -1).Value
Case "A": TheCol = 1
Case "B": TheCol = 2
Case "C": TheCol = 3
Case "D": TheCol = 4
Case "E": TheCol = 5
Case "F": TheCol = 6
Case "G": TheCol = 7
Case "H": TheCol = 8
Case "I": TheCol = 9
End Select
With Sheets("Sheet2")
.Cells(Rows.Count,
TheCol).End(xlUp).Offset(1).Value
=
i.Value
End With
Next i
End Sub
"Trina" wrote in message
...
I have a worksheet with 2 colums. The rating column will contain
1
of 9
scores. There are about 50 data lines. I need to goup them by
that
score
in
a new worksheet in a block format. I added the example and look
of
finished
product I need. Can a macro or Excel function make this work?

Data Worksheet:
Rating Name
1A Smith
1A Jerry
2A Jones
3A Daye
1B Wilson
2B Johnson
2B Wint
3B Lager
1C Swith
2C Jackson
3C Cole


Output Worksheet
__________________________________________________ ________________
|All 1C listed here | All 1B listed here |
All
1A listed here |
| Swith | Wilson
|
Smith |
| |
|
Jerry |
|__________________|______________________|_______ ________________|
|All 2C listed here | All 2B listed here |
All
2A listed here |
| Jackson | Johnson |
Jones |
| | Wint
|
|
|__________________|______________________|_______ ________________|
|All 3C listed here | All 3B listed here |
All
3A listed here |
| Cole | Lager
|
Daye |
|__________________|______________________|_______ ________________|
--
Trina











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
How do I use a formula on wk sheet 2 to pull data from wk sheet 1 WFG3000 Excel Discussion (Misc queries) 1 December 13th 07 06:58 AM
VLookup / pull data from 1 sheet to another nastech Excel Discussion (Misc queries) 1 June 20th 07 08:30 PM
Pull data from multiple sheet jillteresa Excel Worksheet Functions 1 May 19th 06 05:44 PM
How do I pull certain data from several worksheets in one sheet? Deler Excel Worksheet Functions 0 July 28th 05 06:45 PM
pull data from sheet two, then fill in the data to sheet one (part Jim Excel Worksheet Functions 3 December 11th 04 04:51 AM


All times are GMT +1. The time now is 01:24 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"