+ Reply to Thread
Results 1 to 8 of 8

Retrieve Data from Columns in one Workbook into another Workbook

  1. #1
    Registered User
    Join Date
    12-04-2012
    Location
    us
    MS-Off Ver
    excel 2011
    Posts
    5

    Retrieve Data from Columns in one Workbook into another Workbook

    I have workbook1 and workbook2.
    I need to create macro to copy the Column B (Starts from B4 to the end of Column B) in workbook2, sheet 1
    into Workbook1, column A, starts from A2
    How to write the Macro Code

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Retrieve Data from Columns in one Workbook into another Workbook

    Hi,

    Try this:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.

    Open a macro-enabled Workbook or save your Workbook As Macro-Enabled

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    12-04-2012
    Location
    us
    MS-Off Ver
    excel 2011
    Posts
    5

    Re: Retrieve Data from Columns in one Workbook into another Workbook

    It said debug with Set w1 = Workbooks("Workbook4").Worksheets("Sheet1")

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Retrieve Data from Columns in one Workbook into another Workbook

    Did you have the workbooks open??

  5. #5
    Registered User
    Join Date
    12-04-2012
    Location
    us
    MS-Off Ver
    excel 2011
    Posts
    5

    Re: Retrieve Data from Columns in one Workbook into another Workbook

    Yes I have all the workbook opened
    Quote Originally Posted by xladept View Post
    Did you have the workbooks open??

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Retrieve Data from Columns in one Workbook into another Workbook

    Is Sheet1 the correct Sheet name? The code works for me???

  7. #7
    Registered User
    Join Date
    12-04-2012
    Location
    us
    MS-Off Ver
    excel 2011
    Posts
    5

    Thumbs up Re: Retrieve Data from Columns in one Workbook into another Workbook

    Oh yeah, it works now. Maybe because i was using the MAC it works well on my PC. thanks

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Retrieve Data from Columns in one Workbook into another Workbook

    You're welcome!

+ 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