Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2011, 06:03 AM
Kaloyanski Kaloyanski is offline How can I merge different excel files into one? Windows 7 64bit How can I merge different excel files into one? Office 2010 64bit
Novice
How can I merge different excel files into one?
 
Join Date: Oct 2011
Posts: 1
Kaloyanski is on a distinguished road
Default How can I merge different excel files into one?

Greetings!



My question is how can I merge different excel files/workbooks into 1 file? Is there any formula so that I do not do it manually? Can you please help me?

Edit:I am using Excel 2010 Thanks
Thanks in advance.
Kaloyan
Reply With Quote
  #2  
Old 10-31-2011, 12:39 AM
Catalin.B Catalin.B is offline How can I merge different excel files into one? Windows Vista How can I merge different excel files into one? Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

You can try this macro: (first select all worksheets to be merged with ctrl+sheet tab)
Code:
Sub MergeSheets()

'  Appends data from all the selected worksheets onto the end of the
'  active worksheet.

   Const NHR = 1     'Number of header rows to not copy from each MWS
   
   Dim MWS        As Worksheet   'Worksheet to be merged (appended)
   Dim AWS        As Worksheet   'Worksheet to which the data are transferred
   Dim FAR        As Long        'First available row on AWS
   Dim LR         As Long        'Last row on the MWS sheets
   
   Set AWS = ActiveSheet
   
   For Each MWS In ActiveWindow.SelectedSheets
      If Not MWS Is AWS Then
         FAR = AWS.UsedRange.Cells(AWS.UsedRange.Cells.Count).Row + 1
         LR = MWS.UsedRange.Cells(MWS.UsedRange.Cells.Count).Row
         MWS.Range(MWS.Rows(NHR + 1), MWS.Rows(LR)).Copy AWS.Rows(FAR)
      End If
   Next MWS

End Sub
Reply With Quote
  #3  
Old 11-02-2011, 02:03 AM
Nirik's Avatar
Nirik Nirik is offline How can I merge different excel files into one? Windows XP How can I merge different excel files into one? Office 2003
Smart Novice
 
Join Date: Dec 2010
Location: Mumbai, India
Posts: 24
Nirik is on a distinguished road
Default

Dear Catalin.B
The code provided above is possible for merging different sheets of one file into one, but if someone want to merge different files date (having same headers) into one file can the code will be helpfull.
Reply With Quote
  #4  
Old 11-02-2011, 02:47 AM
Catalin.B Catalin.B is offline How can I merge different excel files into one? Windows Vista How can I merge different excel files into one? Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

for merging different workbooks, you can find an appropriate code here:
(for merging all workbooks, or just a range from selected workbooks, and so on)
http://msdn.microsoft.com/en-us/libr...ice.12%29.aspx
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I merge different excel files into one? Need macro to merge files in Word and preserve formatting Carolin Word VBA 3 12-14-2014 04:01 AM
Mail Merge and Files on Network Drive Joe Switch Mail Merge 0 09-15-2011 09:06 AM
How can I merge different excel files into one? convert multiple csv files to multiple excel files mit Excel 1 06-14-2011 10:15 AM
Importing many vcf files in excel shiflerg Excel 0 01-26-2011 09:16 AM
How can I merge different excel files into one? Opening multiple Excel files within the same Excel window. lost9471 Excel 2 05-01-2010 01:57 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft