+ Reply to Thread
Results 1 to 7 of 7

Adding Columns and Fucntions Into Columns to Many Spreadsheets in a Row

  1. #1
    Registered User
    Join Date
    02-10-2013
    Location
    PR
    MS-Off Ver
    Excel 2003
    Posts
    93

    Adding Columns and Fucntions Into Columns to Many Spreadsheets in a Row

    I'm very, very new to macros and coding.

    So, I need help!

    About the data and my spreadsheets:

    1. All the data is in Column A
    2. The data is space delimited
    3. The spreadsheets are quite large. Column A may have anywhere from 500,000 to 1,000,000 cells populated
    4. I have over 100 spreadsheets

    Is there a way to have a macro or a code I could run to do the following to all the spreadsheets?

    1. Take all the data in Column A and separate it into the adjacent columns ('Columns to text'?)
    2. Insert 10 columns before Column A? That would mean that the data in Column A would then move to Column K...
    3. Insert a function of my choice into all the cells in Column J? Which would calculate values based on the values in the adjacent columns...
    4. Insert another function into all the cells in Column Z? Which would also calculate values based on the values in the (latter) adjacent columns...

    I'm, of course, trying to do all of this without opening up each spreadsheet individually...

    Please let me know! Thanks!

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Adding Columns and Fucntions Into Columns to Many Spreadsheets in a Row

    All can be done.
    Yet,it would be very helpful to see a sample of the data and the outcome ..

  3. #3
    Registered User
    Join Date
    02-10-2013
    Location
    PR
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: Adding Columns and Fucntions Into Columns to Many Spreadsheets in a Row

    Quote Originally Posted by rcm View Post
    All can be done... it would be very helpful to see a sample of the data and the outcome ..
    Wow! Nice! I've uploaded an example with a tiny sample of data, representative of the data but, the real spreadsheets are inmense! Thanks!


    example.xlsx
    Last edited by olives; 05-09-2013 at 12:05 PM.

  4. #4
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Adding Columns and Fucntions Into Columns to Many Spreadsheets in a Row

    I wrote a macro to do what you requested..

    in order to run properl you need to adjust

    path: the actual path were all your files are

    fname: the real name for the files hopefully there is pattern on the names
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-10-2013
    Location
    PR
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: Adding Columns and Fucntions Into Columns to Many Spreadsheets in a Row

    Quote Originally Posted by rcm View Post
    I wrote a macro to do what you requested..

    in order to run properl you need to adjust

    path: the actual path were all your files are

    fname: the real name for the files hopefully there is pattern on the names
    Wow! Nice! I'll look at it tonight! Pretty cool! I hate to wait but I'm at work right now and busy with some other stuff, so I'll run it later in the day... Thanks, rcm!

  6. #6
    Registered User
    Join Date
    02-10-2013
    Location
    PR
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: Adding Columns and Fucntions Into Columns to Many Spreadsheets in a Row

    Quote Originally Posted by rcm View Post
    I wrote a macro to do what you requested..

    in order to run properl you need to adjust

    path: the actual path were all your files are

    fname: the real name for the files hopefully there is pattern on the names
    Ok, I'm looking at the code below in Module1:

    Please Login or Register  to view this content.
    Am I looking at the right thing? I change the path the path at:
    Please Login or Register  to view this content.
    right?

    The files are all named Book2.xlsx through Book174.xslx....

    At this line:

    Please Login or Register  to view this content.

    I have to change ".xls" to ".xlsx", right?

    If they are all named Book2.xlsx through Book174.xslx.... how do I make a reference to the filenames? Thanks, rcm... Appreciate it!

  7. #7
    Registered User
    Join Date
    02-10-2013
    Location
    PR
    MS-Off Ver
    Excel 2003
    Posts
    93

    Re: Adding Columns and Fucntions Into Columns to Many Spreadsheets in a Row

    Quote Originally Posted by rcm View Post
    I wrote a macro to do what you requested..

    in order to run properl you need to adjust

    path: the actual path were all your files are

    fname: the real name for the files hopefully there is pattern on the names
    I've got a few more questions.

    About these lines:

    Please Login or Register  to view this content.

    These are the lines that add the functions, right?

    What would I have to add, and where, if I also wanted to add values to cells in other columns?... Thanks! Let me know if I can clear the questions up! Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1