PC Review


Reply
Thread Tools Rate Thread

Displaying data Horizontally

 
 
Shaijuzacharia@gmail.com
Guest
Posts: n/a
 
      22nd Oct 2008
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
 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      22nd Oct 2008
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


"(E-Mail Removed)" 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
>

 
Reply With Quote
 
Joel
Guest
Posts: n/a
 
      22nd Oct 2008
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


"(E-Mail Removed)" 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
>

 
Reply With Quote
 
Shaijuzacharia@gmail.com
Guest
Posts: n/a
 
      22nd Oct 2008
On Oct 22, 11:10*am, Joel <J...@discussions.microsoft.com> 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
>
>
>
> "Shaijuzacha...@gmail.com" 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying data horizontally Kelly Microsoft Access Reports 0 11th Feb 2009 07:31 PM
selecting row data and displaying horizontally AndrewOfAzotus Microsoft Access Form Coding 5 3rd Aug 2008 01:30 AM
displaying report fields horizontally instead of vertically =?Utf-8?B?U2hhd24=?= Microsoft Access Reports 1 23rd Jul 2005 07:23 PM
Displaying a horizontally scrollable row of thumbnail images Lew Barnesson Microsoft Dot NET Framework Forms 1 29th Apr 2005 07:01 PM
Displaying Data Horizontally BobB Microsoft Access Reports 1 22nd Nov 2003 03:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:21 AM.