LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default merge data macro


Hi,

You could put something like the following in a third workbook or an add-in.
When run, it prompts the user for the location of the source & target
workbooks, opens them so you can do stuff, and then closes them. Without
knowing what your sheets contain I can't help with the merge...

sub test()

dim xwb as workbbook
dim wb as workbook

Dim fd As FileDialog

'Open source workbook

Set fd = Application.FileDialog(msoFileDialogFilePicker)
If fd.Show = False Then Exit Sub
sPath = fd.SelectedItems(1)
Set xwb = Workbooks.Open(sPath)

'Open target workbook
Set fd = Application.FileDialog(msoFileDialogFilePicker)
If fd.Show = False Then Exit Sub
sPath = fd.SelectedItems(1)
Set wb = Workbooks.Open(sPath)

'Do what you want with the workbooks

'Close workbooks
xwb.close
wb.close

end sub

Sam

"Julie" wrote:

I am looking for a macro to merge data from a source workbook to a
destination workbook with a common key. However, the macro cannot reside in
either the source or the destination workbooks. The destination workbook is
received from an external source (format remains the same, only the data
changes) and the source workbook is exported from MSAccess which replaces the
previous file each time.

Hope someone can help.

 
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
Macro or Formula to merge data CandiC Excel Discussion (Misc queries) 6 April 23rd 09 01:22 AM
Mail merge macro: select recipients from Excel during merge Worksmart Excel Programming 0 May 18th 08 06:37 PM
Can I merge data in 2 sheets matching rows of data by last name? Corb Excel Discussion (Misc queries) 1 March 18th 07 05:32 PM
mail merge excludes my headers and critical data in Word merge Nix Excel Discussion (Misc queries) 0 April 21st 06 08:35 PM
how do i get my mail merge to update the data source at each merge Steel_Monkey Excel Discussion (Misc queries) 0 November 30th 05 08:41 AM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"