+ Reply to Thread
Results 1 to 4 of 4

Run Macro in closed workbook and copy specific coloumn in active workbook

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    713

    Run Macro in closed workbook and copy specific coloumn in active workbook

    Hi,

    I need help in putting all these code together.

    This code helps to open the closed workbook.

    Please Login or Register  to view this content.
    Macro which would run is below

    Please Login or Register  to view this content.
    Now I want below thing to happen :

    1) Copy the entire coloum C, coloum H and coloum J and past it in my opened workbook in sheet name "E register"
    2) Close the closed workbook which I opened to run this macro.

    Please advice
    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: Run Macro in closed workbook and copy specific coloumn in active workbook

    Hi, shiva_reshs,

    maybe the code for your simple macro could be redurced to
    Please Login or Register  to view this content.
    Maybe the integration may be made like this, you haventīstated where to put the data so I assumed to replace the existing data in the sheet:
    Please Login or Register  to view this content.
    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

  3. #3
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    713

    Re: Run Macro in closed workbook and copy specific coloumn in active workbook

    Hi Holger,

    How can I make Target workbook to be dynamic, So user can pick which workbook he want to open?

    Thanks,
    Shiva

  4. #4
    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: Run Macro in closed workbook and copy specific coloumn in active workbook

    Hi, Shiva ,

    maybe use GetOpenFilename for that which will return the path and the name of the chosen workbook or False if Cancel has been pressed.

    Please Login or Register  to view this content.
    FileToOpen will hold path & filename while strFileName will only hold the name and extension of teh file chosen.

    HTH,
    Holger

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to copy row to specific sheet in closed workbook
    By newbie-excel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-04-2013, 12:51 PM
  2. Copy worksheet from closed workbook into active/existing workbook.
    By rasikvekaria in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2012, 06:55 AM
  3. Macro operates on 'closed' workbook & Current Active WB
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-04-2011, 08:48 AM
  4. Questions on copying range from closed workbook to active workbook
    By stevebriz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2007, 09:45 AM
  5. Closing Hidden Workbook when Active Workbook is Closed
    By SusanK521 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-23-2005, 08:05 PM

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