Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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
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
Another Join/Merge Question Dave Excel Worksheet Functions 2 October 10th 08 11:52 AM
Join Excel Tables MT MEX Excel Discussion (Misc queries) 2 September 30th 08 10:08 PM
Join tables like inner join in Access ryanp Excel Discussion (Misc queries) 2 July 18th 08 03:35 PM
Merge or Join Worksheets Kevin Excel Discussion (Misc queries) 0 October 4th 07 09:42 PM
How do I join or merge worksheets in Excel PurpleMel Excel Discussion (Misc queries) 3 June 11th 07 10:58 PM


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