+ Reply to Thread
Results 1 to 2 of 2

Using VBA to copy from another workbook in directory

  1. #1
    Registered User
    Join Date
    03-04-2013
    Location
    test
    MS-Off Ver
    Excel 2003
    Posts
    1

    Using VBA to copy from another workbook in directory

    Hey guys,

    I am fairly new to VBA and was hoping to get some of the expertise from the community here!

    I have written a code inside DataExtract.XLSM to loop through a directory and open the workbooks inside, one by one.
    With each workbook opened, i would like to copy data from a cell (A1) and copy it back into DataExtract.

    The issue i am having is how to write a method in one workbook and reference the second workbook to copy data from?
    Please Login or Register  to view this content.

    Thanks!

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Using VBA to copy from another workbook in directory

    Hi, mykoolspam,

    you´re quiet about the code you have so far but if you want to Copy that should be the first part of the code with the destination followed. Maybe you change into the VBE, press F2 and enter Copy into the search window for a dive into the VBA Help.

    This might be an alternative as no information from your code is avaliable, code must be placed in DataExtract.XLSM to make good use of ThisWorkbook (although I would prefer to set objects to the workbooks and worksheets for clarification):
    Please Login or Register  to view this content.
    It will store the value from the ActiveWorkbook and ActiveSheet Range("A1") below on the activesheet in the workbook with the code. Working with ActiveSheet isn´t really what I would call reliable.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ 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