Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
PJS PJS is offline
external usenet poster
 
Posts: 23
Default Help with IF? MATCH? INDEX?

Hello, I am trying to do the following, but I can't seem to come up with a
forumla.

Let say I have a table below

Group
Name A B C
Pete N Y N
Jane Y N Y
John N Y Y

is it possible to create a new sheet to to show the "Y" values?

Group Name
A Jane
B Pete
B John
C Jane
C John

thanks,

PJS
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Help with IF? MATCH? INDEX?

Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long, j As Long
Dim LastRow As Long
Dim LastCol As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = LastRow To 1 Step -1

LastCol = .Cells(i, .Columns.Count).End(xlToLeft).Column
For j = LastCol To 2 Step -1

If .Cells(i, j).Value = "Y" Then

.Rows(i + 1).Insert
.Cells(i + 1, "A").Value = .Cells(1, j).Value
.Cells(i + 1, "B").Value = .Cells(i, "A").Value
End If
Next j
.Rows(i).Delete
Next i

.Range("A1").Value = "Group"
.Range("B1").Value = "Name"
.Range("C1").Resize(, 100).Value = ""
.Columns("A:B").Sort key1:=.Range("A2"), order1:=xlAscending, _
key1:=.Range("B2"), order1:=xlAscending, _
header:=xlYes
End With

End Sub

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"PJS" wrote in message
...
Hello, I am trying to do the following, but I can't seem to come up with a
forumla.

Let say I have a table below

Group
Name A B C
Pete N Y N
Jane Y N Y
John N Y Y

is it possible to create a new sheet to to show the "Y" values?

Group Name
A Jane
B Pete
B John
C Jane
C John

thanks,

PJS



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
index Match, or Vlookup Match.. news.transedge.com Excel Worksheet Functions 1 August 3rd 07 02:00 AM
index match array function-returning only first match, need last. Julie Olsen Excel Worksheet Functions 3 December 29th 06 12:50 AM
How do I display more than one match in a Index/Match formula? Trish Excel Worksheet Functions 0 September 26th 05 10:21 PM
index,match,match on un-sorted data Brisbane Rob Excel Worksheet Functions 3 September 24th 05 10:04 PM
Index/Match Help Ben Excel Worksheet Functions 6 December 2nd 04 01:01 PM


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