Combining Rows from different workbooks...

G

Guest

How can I combine different number of rows from different workbooks. Like
Book1>Sheet1 is having 55 rows and Book2>Sheet1 is having 130 rows in same
format. I need these rows to be stacked in another workbook like Book3 will
be having 185 rows. Do I need to write a VB code or any other utility is
availabel ?
 
G

Guest

you can use macro like below i mentioned:

Sub MrgAll()
Dim intI As Integer, i As Long, ii As Long
i = 1
For intI = 2 To ThisWorkbook.Sheets.Count
ii = ThisWorkbook.Sheets(intI).UsedRange.Rows.Count
ThisWorkbook.Sheets(intI).Range("A1:IV" & ii).Copy Range("A" & i)
i = ii + i + 1
Next intI
End Sub

Above mentioned macro will copy all data from all sheet (except first sheet)
to First sheet. I think this will be usefull for you.

pls do rate.
 
G

Guest

How about:

Sub irfan()
Dim r As Range
Workbooks("b1.xls").Sheets("s1").UsedRange.Copy _
Workbooks("b3.xls").Sheets("s1").Range("A1")

Workbooks("b3.xls").Activate
Sheets("s1").Activate

Set r = ActiveSheet.UsedRange
rrow = r.Rows.Count + r.Row

Workbooks("b2.xls").Sheets("s1").UsedRange.Copy _
Workbooks("b3.xls").Sheets("s1").Cells(rrow, "A")

End Sub
 
G

Guest

Hi,

Save workbooks in an arranged workspace

When you open a workspace file (workspace file: A file that saves display
information about open workbooks, so that you can later resume work with the
same window sizes, print areas, screen magnification, and display settings. A
workspace file doesn't contain the workbooks themselves.), Microsoft Excel
opens each workbook saved in the workspace.

Open the workbooks you want to save in a workspace.
Size and arrange the workbook windows as you want them to appear when you
open the workspace.
On the File menu, click Save Workspace.
In the File name box, type a name for the workspace file.

Tip

To open the workbooks each time you start Excel, save the workspace file in
an alternate startup folder (alternate startup folder: A folder in addition
to the XLStart folder that contains workbooks or other files that you want to
be opened automatically when you start Excel and templates that you want to
be available when you create new workbooks.). Save only the workspace file,
not the workbook files, in the alternate startup folder.

**********************************************************

For more information, please refer to the following topic in the Microsoft
Excel 2003 online help:

"About consolidating data in multiple worksheets "

Challa Prabhu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top