Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a table from a matrix

Status
Not open for further replies.

input1000

Technical User
Sep 8, 2009
17
0
0
CA
I have 2 tables.

TblTag - This consists of tags i.e. LIT-11000
This table has many columns, the ones that matter is the - TAG and FUNCTION
FUNTION - is the LIT portion of the TAG

TblMatrix - This consists of a matrix style table.
Down the First column are all the possible FUNCTIONS(ie. LIT)
The next 30 columns are the different Exhibits(documents that must be filled out for the item)
There is a TRUE when a Exhibit is needed for the FUNCTION and a FALSE when a Exhibit is not needed.

I need to someone how create a query or something that will compare my FUNCTIONS from tblTag to my TblMatrix and make a new table tlbExhibit

This table would consist of 1 TAG for each Exhibit that was listed in the matrix.
For example:

[tblTAG]
TAG DESCRIPTION FUNCTION DRAWING
LIT-1100 Level Indicator LIT XXX-XXX
LIT-1133 Level Indicator LIT XXX-YYY

[tblMatrix]
TAG Exhibit 1 Exhibit 2 Exhibit 3 Exhibit 4
LIT TRUE TRUE FALSE TRUE

[tblExhibit]
TAG EXHIBIT
LIT-1100 Exhibit 1
LIT-1100 Exhibit 2
LIT-1100 Exhibit 4
LIT-1133 Exhibit 2
 
Is there a reason you can't set up tblMatrix like this (normalized)? :

TAG ExhibitNum ExhibitNeeded

Cogito eggo sum – I think, therefore I am a waffle.
 
I could do that yes.
I figure I should put this up. It's excell code, but its how I changed the Matrix into a List.

Sub MatrixList()
Dim aData
Dim cList As New Collection
Dim i As Integer
Dim j As Long
Dim c As Range

aData = Range("a3"). CurrentRegion
For j = 2 To UBound(aData, 1)
For i = 2 To UBound(aData, 2)
If Not IsEmpty(aData(j, i)) Then _
cList.Add aData(j, 1) & " " & aData(1, i) & " " & aData(j, i)
Next i
Next j
j = 0
For Each c In Range("a3").End(xlDown).Offset(, i).Resize(cList.Count, 1)
j = j + 1
c = cList(j)
Next c
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top