+ Reply to Thread
Results 1 to 4 of 4

Macro Needed in Excel 2007 for opening Files

  1. #1
    Registered User
    Join Date
    10-24-2011
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    27

    Macro Needed in Excel 2007 for opening Files

    Hi All,

    I'm new to using macros etc and have no experience in how to use VBA but believe this is the way forward for what I'm looking to do (if it is even possible!!)

    Essentially, what I want to do, is to have a macro that looks at a particular cell and then opens a file (which is in a specific folder), sorts the data, copies some of the data and then pastes it into a table the original spreadhseet. It then repeats this for a different file in a different folder.
    It would then need to do this for several cells within the original spreadsheet.

    Can anyone help??

    Cheers

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Macro Needed in Excel 2007 for opening Files

    hello this will look for A1 - the file name to be opened.

    Please Login or Register  to view this content.

    sorts the data, copies some of the data and then pastes it into a table the original spreadhseet
    this depends on the opened worksheet what part to be sorted out, etc.

    HTH
    Last edited by vlady; 10-24-2011 at 05:37 PM.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Macro Needed in Excel 2007 for opening Files

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

    The easiest way to get started is to record the macro, then edit it.
    Last edited by royUK; 10-24-2011 at 08:08 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    10-24-2011
    Location
    Leeds, England
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Macro Needed in Excel 2007 for opening Files

    Hi,

    Thanks for your posts.

    To help, I've attached some files. The first file (Macro template) is the file I want data pasted into. The second and third files contain the data I need.

    I think I will need several macros but I want to be able to look at a cell in the macro template file (in this case cells B8, B47 and B87) which has my "Pack ID" and then open the second file which has the data. The data needs to be sorted in alphabetical order (currently A01, C01, E01 etc etc, needs to be A01, A02, A03 etc). and then paste just the data (column B) into the 'tube sent' column in the original file. It then does the same for the second data file and pastes into the 'tube received' column.

    I have no experience of VBA, so I really don't know how to open the area I need to edit the VBA or enter any VBA or anything. Recording a macro at the moment does everything I want but is limited to only opening the file I use while recording the macro, where I want it to open the file specific to B8, B47, B87 etc.

    Thanks

    Toby
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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