LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help on a consolidation macro


I am trying to collect data from a bunch of sheets. But when I run the
macro it pastes the information in the same column. I would like to
copy the information in rows next to each other.
Can anyone help?

Example. This is how it currently posts the data
12
34
56
78
90

This is how I wish to post the data
12 34 56 78 90

Thanks, in advance,
K

If IsArray(FName) Then
Application.ScreenUpdating = False
Set basebook = ThisWorkbook
rnum = 1
basebook.Worksheets(1).Cells.Clear
'clear all cells on the first sheet

For N = LBound(FName) To UBound(FName)
Set mybook = Workbooks.Open(FName(N))
Set sourceRange = mybook.Worksheets("Detail Testing
Results").Range("c3:d30")
SourceRcount = sourceRange.Rows.Count
Set destrange = basebook.Worksheets(1).Cells(rnum, "A")

basebook.Worksheets(1).Cells(rnum, "AE").Value =
mybook.Name
' This will add the workbook name in column D if you want

With sourceRange
Set destrange = basebook.Worksheets(1).Cells(rnum,
"A"). _
Resize(.Rows.Count,
..Columns.Count)
End With
destrange.Value = sourceRange.Value

mybook.Close False
rnum = rnum + SourceRcount
Next
End If
ChDrive SaveDriveDir
ChDir SaveDriveDir
Application.ScreenUpdating = True
End Sub


--
bobbak
------------------------------------------------------------------------
bobbak's Profile: http://www.excelforum.com/member.php...o&userid=22495
View this thread: http://www.excelforum.com/showthread...hreadid=480195

 
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
Consolidation Raja Excel Discussion (Misc queries) 3 January 20th 08 03:29 AM
Consolidation reno Excel Discussion (Misc queries) 0 October 31st 07 09:07 PM
A macro for data consolidation SR Excel Discussion (Misc queries) 6 July 13th 06 04:19 PM
consolidation nance666 Excel Discussion (Misc queries) 1 August 26th 05 01:49 PM
Consolidation kk Excel Worksheet Functions 8 June 14th 05 01:41 PM


All times are GMT +1. The time now is 08:30 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"