Strange place to ask - need some urgent Excel help (read post)

StarFyre

Active member
Hello,

@ work rite now, so can't register @ a s/w forum (can't get the confirmation emails to activate accts), etc. So this place was first choice 2 try and ask.

need some excel help.

I have tables as below and need the merge example below.

List 1
a
b
c

table 1

x t
y u
z v

What I need is final output:

Table Merged
a x t
a y u
a z v
b x t
b y u
b z v
c x t
c y u
c z v

Is there a function to automatically select the 2 input tables and make it output the merged?

I can't find a function to do it, or a formula (atleast, can't think of it right now if there is one).
Also, i don't know Visual Basic to write a program to do it :(

Any help would be appreciated.

Regards,

Sanjay
 
Last edited:

PegaZus

Stealth Freak
Yeah, I can't think of anything right off hand (even tried in excel). And I'm assuming that the letters represent actual numbers.

You could try a vlookup perhaps, but that may be more effort than just making a giant copy/paste of equations pointing to the correct cells.
 

noneedforaname

New member
Are you adding or multiplying the figures from the two columns if so that's pretty easy and can probably tell you how (if I can make my brain work) so what is it your after?
 

StarFyre

Active member
No, i need to put the data into that new table format, so later i can do a 1 to 1 vlookup (to compare tables).

Sanjay
 

skeeve

Member
Ok, it is a strange place to ask and even stranger that I have noticed it. If you dropped it on one of Excel forums you would get your code much sooner. So, what you see below is a code that does what you asked in your in your original posting before you edited it. Sorry, I saw this post in the morning and I got around to write it only now. It is not very elegant but it does the job. PM me if you need help using it.

____________________________________________________________________________________________________________________________________________

Sub reformating()

'reformats table ' it is assumed that original table
'a x t ' is in columns A,B,C
'b y u ' Place cursor into column D
'c z v ' Your output will be in columns E,G,F
' to the format bellow
'
'a x t
'a y u
'a z v
'b x t
'b y u
'b z v
'c x t
'c y u
'c z v


nA1 = Range("A1", Range("A1").End(xlDown)).Count ' determines the # of rows
bp = 1

For X = 1 To nA1 * nA1

ActiveCell.Offset(X - 1, 1) = Cells(bp, 1)
ActiveCell.Offset(X - 1, 2) = Cells((X - nA1 * (bp - 1)), 2)
ActiveCell.Offset(X - 1, 3) = Cells((X - nA1 * (bp - 1)), 3)


If Int(X / nA1) = X / nA1 Then
bp = bp + 1
End If
Next

End Sub
 
Last edited:

Donna111

New member
HI there
You can free to decide to
merge Excel documents into a single one, and then save the combined Excel file to memory stream with following C# demo code. /// <summary>
/// Combine a list of Excel document into a single one and save it to stream
/// </summary>
/// <param name="s"></param>
/// <param name="docList"></param>
public void CombineDocumentsToStream(MemoryStream s, List<BaseDocument> docList)
{

XLSXDocument.Combine(docList, s);
 
Back To Top
Top