+ Reply to Thread
Results 1 to 5 of 5

macro to transfer data from one file to another

  1. #1
    Registered User
    Join Date
    06-19-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question macro to transfer data from one file to another

    I'm new to vba programming and was trying to make a pc of code using bits of info from the net, but it isn't working. pls some one help me write it.

    problem:
    i have two files a.xls and b.xls . in a.xls (sheet 1) there is a column(column A) with names of people. And in b.xls(sheet 1) in column A there is a longer list of names and in column B their phone nos. i want to write a vba code to take each name in a.xls and find it in b.xls and take the phone no. from b.xls and write it into the first file.

    this is the code iv written, you may correct it or write ur own:
    Please Login or Register  to view this content.
    Last edited by sha_ch; 06-21-2010 at 11:25 PM. Reason: Added Code Tags

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

    Re: macro to transfer data from one file to another

    You don't need VBA, VLOOKUP will do that
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-19-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: macro to transfer data from one file to another

    can u please write down how vlookup will let me access data in another file. please write the formula

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

    Re: macro to transfer data from one file to another

    This formula in Book2 will lookup the value in B1 in a table in Book1

    =VLOOKUP(B1,[Book1]Sheet1!$A$1:$B$4,2,FALSE)

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

    Re: macro to transfer data from one file to another

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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