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

Hi,

I have got data in say ten workbooks.

I wanted to consolidate in one sheet in another workbook.

I wanted the data in cell B2 of the sheets to be displayed in the
consolidated sheet from C2 to L2(Horizontally) i.e, data in B2 of the
sheet in the first workbook to be copied and pasted special with
values in the C2 of the consolidated sheet in the other work book,
then B2 of the sheet in the second workbook to D2, then B2 of the
third workbook to E2 of the consolidated sheet and so on.


Could you please help me in this.

Thanks,
Shaiju
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Displaying data Horizontally

You need to put all the files into the same folder. Also the Sumarry
workbook should not be in the same folder. The code is expecting the
worksheet name of the data in the 10 workbooks to be sheet1. Change the
sheet name as required.

Sub consolidate()

Folder = "C:\temp\"
FName = Dir(Folder & "*.xls")
ColCount = 3
Do While FName < ""
Set bk = Workbooks.Open(Filename:=Folder & FName)

Cells(1, ColCount) = FName
Cells(2, ColCount) = bk.Sheets("Sheet1").Range("B2")

bk.Close savechanges:=False
FName = Dir()
Loop
End Sub


" wrote:

Hi,

I have got data in say ten workbooks.

I wanted to consolidate in one sheet in another workbook.

I wanted the data in cell B2 of the sheets to be displayed in the
consolidated sheet from C2 to L2(Horizontally) i.e, data in B2 of the
sheet in the first workbook to be copied and pasted special with
values in the C2 of the consolidated sheet in the other work book,
then B2 of the sheet in the second workbook to D2, then B2 of the
third workbook to E2 of the consolidated sheet and so on.


Could you please help me in this.

Thanks,
Shaiju

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Displaying data Horizontally

I forgot to increment the ColCount

Sub consolidate()

Folder = "C:\temp\"
FName = Dir(Folder & "*.xls")
ColCount = 3
Do While FName < ""
Set bk = Workbooks.Open(Filename:=Folder & FName)

Cells(1, ColCount) = FName
Cells(2, ColCount) = bk.Sheets("Sheet1").Range("B2")

ColCount = ColCount + 1
bk.Close savechanges:=False
FName = Dir()
Loop
End Sub


" wrote:

Hi,

I have got data in say ten workbooks.

I wanted to consolidate in one sheet in another workbook.

I wanted the data in cell B2 of the sheets to be displayed in the
consolidated sheet from C2 to L2(Horizontally) i.e, data in B2 of the
sheet in the first workbook to be copied and pasted special with
values in the C2 of the consolidated sheet in the other work book,
then B2 of the sheet in the second workbook to D2, then B2 of the
third workbook to E2 of the consolidated sheet and so on.


Could you please help me in this.

Thanks,
Shaiju

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Displaying data Horizontally

On Oct 22, 11:10*am, Joel wrote:
I forgot to increment the ColCount

Sub consolidate()

Folder = "C:\temp\"
FName = Dir(Folder & "*.xls")
ColCount = 3
Do While FName < ""
* *Set bk = Workbooks.Open(Filename:=Folder & FName)

* *Cells(1, ColCount) = FName
* *Cells(2, ColCount) = bk.Sheets("Sheet1").Range("B2")

* *ColCount = ColCount + 1
* *bk.Close savechanges:=False
* *FName = Dir()
Loop
End Sub



" wrote:
Hi,


I have got data in say ten workbooks.


I wanted to consolidate in one sheet in another workbook.


I wanted the data in cell B2 of the sheets to be *displayed in the
consolidated sheet from C2 to L2(Horizontally) i.e, data in B2 of the
sheet in the first workbook to be copied and pasted special with
values in the C2 of the consolidated sheet in the other work book,
then B2 of the sheet in the second workbook to D2, then B2 of the
third workbook to E2 of the consolidated sheet and so on.


Could you please help me in this.


Thanks,
Shaiju- Hide quoted text -


- Show quoted text -


Thank you very much Joel.....
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
Selecting vertical rows and displaying them horizontally. chrisvail Excel Discussion (Misc queries) 2 October 6th 09 11:48 PM
Add average data horizontally into existing chart Erin Charts and Charting in Excel 2 February 24th 09 08:11 AM
show XML data horizontally blackpuppy Excel Programming 2 April 18th 06 02:56 AM
want to cut data from vertical cells and paste them horizontally. charter_SKR Excel Discussion (Misc queries) 2 March 29th 06 04:42 PM
copying data horizontally Alex Excel Worksheet Functions 1 April 11th 05 05:34 PM


All times are GMT +1. The time now is 05:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"