Solved

tranform row to column...across 500 excel workbooks

Posted on 2015-02-17
21
90 Views
Last Modified: 2016-02-11
i have a folder of 500 workbooks

i have data in a1
then across row 2 --- of varying length

i need to append all this data into one column

i would like to do it across every workbook automaticaly
0
Comment
Question by:finnstone
  • 12
  • 9
21 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 40613990
Please post a workbook with representative data.
Where do you need to place this transformed data?
0
 

Author Comment

by:finnstone
ID: 40614020
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40614055
Your workbook needs to show what the transformed data should look like.  Please post your files in this thread.
animatedtabs.csv
0
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 

Author Comment

by:finnstone
ID: 40614074
I need All the data in column A that's it
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40614231
0
 

Author Comment

by:finnstone
ID: 40614246
yes
0
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 40614581
Here is a VBA routine to do this for all the csv files in a directory.  Change the cPath string literal to point to the directory with your 500 csv files.
Sub Q_28618360()
    Dim strFilename As String
    Dim wkb As Workbook
    Dim wks As Worksheet
    Const cPath As String = "C:\Users\AikiMark\Downloads\Q_28618360\"
    strFilename = Dir(cPath & "*.csv")
    Do Until Len(strFilename) = 0
        Set wkb = Workbooks.Open(cPath & strFilename)
        Set wks = wkb.Sheets(1)
        wks.Range(wks.Range("A2"), wks.Range("A2").Offset(ActiveSheet.Range("A2").End(xlToRight).Column - 1, 0)).Value = _
            WorksheetFunction.Transpose(wks.Range(wks.Range("A2"), wks.Range("A2").End(xlToRight)).Value)
        wks.Range(wks.Range("B2"), wks.Range("B2").End(xlToRight)).ClearContents
        wkb.Close True
        strFilename = Dir
    Loop

End Sub

Open in new window

0
 

Author Comment

by:finnstone
ID: 40614740
strFilename  is equaling "" everytime ...
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40614811
What does your code look like?
Where are your CSV files?
0
 

Author Comment

by:finnstone
ID: 40614830
i used your code exactly
put it in a module
0
 

Author Comment

by:finnstone
ID: 40614832
yes i modified path to correct path
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40614881
Are you invoking the routine in the module?
0
 

Author Comment

by:finnstone
ID: 40614883
no. how do i do that?
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40614938
just invoke it by name somewhere in the file, usually at the top of the file.

Also, make sure your path ends with a back slash, like mine did.
0
 

Author Comment

by:finnstone
ID: 40614960
beautiful got it :)
0
 

Author Comment

by:finnstone
ID: 40614961
thanks this is awesome!
0
 

Author Closing Comment

by:finnstone
ID: 40614965
great!!
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40615034
Is this a one-time transform?
0
 

Author Comment

by:finnstone
ID: 40615041
yeah already done. posting a new problem though :)
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40615062
post a link to that new question in this thread
0
 

Author Comment

by:finnstone
ID: 40615070
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question