Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combing Workbooks


I have 2 workbooks, Customer & Suppliers, both of which have numerou
worksheets named after the country of origin.

Is there a way of combing these workbooks so that in sheets with th
same name it puts the data underneath any existing data?

Please help ??

--
GazM
-----------------------------------------------------------------------
GazMo's Profile: http://www.excelforum.com/member.php...fo&userid=1461
View this thread: http://www.excelforum.com/showthread.php?threadid=27024

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Combing Workbooks

Maybe this will get you started:

Option Explicit
Sub testme02()

Dim CustWkbk As Workbook
Dim SuplWkbk As Workbook
Dim CombWkbk As Workbook

Dim wks As Worksheet
Dim newWks As Worksheet
Dim destCell As Range

Set CustWkbk = Workbooks("customer.xls")
Set SuplWkbk = Workbooks("supplier.xls")
Set CombWkbk = Workbooks.Add(1)
CombWkbk.Worksheets(1).Name = "deletemelater"

For Each wks In CustWkbk.Worksheets
With wks
Set newWks = CombWkbk.Worksheets.Add
newWks.Name = .Name
Set destCell = newWks.Range("a1")

.Range("a1", .Cells.SpecialCells(xlCellTypeLastCell)).Copy
destCell.PasteSpecial Paste:=xlPasteValues

With newWks
Set destCell = .Range("a" _
& .Cells.SpecialCells(xlCellTypeLastCell).Row + 1)
End With

With SuplWkbk.Worksheets(.Name)
.Range("a1", .Cells.SpecialCells(xlCellTypeLastCell)).Copy
destCell.PasteSpecial Paste:=xlPasteValues
End With
End With
Next wks

Application.DisplayAlerts = False
CombWkbk.Worksheets("deletemelater").Delete
Application.DisplayAlerts = True


End Sub

This assumes that each workbook has each country's worksheet.




GazMo wrote:

I have 2 workbooks, Customer & Suppliers, both of which have numerous
worksheets named after the country of origin.

Is there a way of combing these workbooks so that in sheets with the
same name it puts the data underneath any existing data?

Please help ???

--
GazMo
------------------------------------------------------------------------
GazMo's Profile: http://www.excelforum.com/member.php...o&userid=14610
View this thread: http://www.excelforum.com/showthread...hreadid=270243


--

Dave Peterson

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
combing countblank with sumproduct? Rene Excel Discussion (Misc queries) 3 June 2nd 10 10:52 PM
Combing 2 lists of data bookman3 Excel Discussion (Misc queries) 2 April 23rd 09 06:11 AM
Combing Info. from multiple worksheets Paula Excel Discussion (Misc queries) 2 March 30th 07 03:22 PM
Combing months in ONE Cell Hansel Excel Discussion (Misc queries) 2 January 3rd 06 09:11 PM
Formula Help Combing two AND statements Yogi_Bear_79 Excel Worksheet Functions 1 June 7th 05 07:35 PM


All times are GMT +1. The time now is 10:15 PM.

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"