Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
combing countblank with sumproduct? | Excel Discussion (Misc queries) | |||
Combing 2 lists of data | Excel Discussion (Misc queries) | |||
Combing Info. from multiple worksheets | Excel Discussion (Misc queries) | |||
Combing months in ONE Cell | Excel Discussion (Misc queries) | |||
Formula Help Combing two AND statements | Excel Worksheet Functions |