Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Merge/Join 2 Excel tables
Hey, I found the code below somewhere (sorry, not sure where) a while back:
Sub MergeCols() Dim FBlank As Boolean Dim FRow As Integer FRow = 1 FBlank = IsEmpty(Cells(FRow, 1).Value) Do While FBlank = False Rows(FRow + 1 & ":" & FRow + 1).Insert Shift:=xlDown Cells(FRow, 2).Cut Destination:=Range("A" & FRow + 1) FRow = FRow + 2 FBlank = IsEmpty(Cells(FRow, 1).Value) Loop End Sub Hope it helps. -- RyGuy "ALV" wrote: Also, I'm doing this within an Excel 2007 Add-in, so I'm not importing an XLS file that is external to my app. "ALV" wrote: I'm looking for a fast way to programmatically merge 2 Excel tables into a third using common column[s] as join keys. One idea I had is to convert the tables to ADO.NET DataTables and run a SQL join command on them, then write out the result to Excel. Does that sound reasonable? If so, would someone have the syntax to convert Excel tables to ADO DataTables and back? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Another Join/Merge Question | Excel Worksheet Functions | |||
Join Excel Tables | Excel Discussion (Misc queries) | |||
Join tables like inner join in Access | Excel Discussion (Misc queries) | |||
Merge or Join Worksheets | Excel Discussion (Misc queries) | |||
How do I join or merge worksheets in Excel | Excel Discussion (Misc queries) |