+ Reply to Thread
Results 1 to 2 of 2

VBA how to copy the selected range of data and paste into the new workbook via InputBox

  1. #1
    Registered User
    Join Date
    06-21-2013
    Location
    Wro
    MS-Off Ver
    Excel 2007
    Posts
    18

    VBA how to copy the selected range of data and paste into the new workbook via InputBox

    Hello Everyone.

    Let me describe the problem quickly.

    Please Login or Register  to view this content.
    I want to copy the data from "Data" worksheet, choose a new range in the InputBox and paste the selection there. The problem I cannot defeat is: how to choose a range in a different workbook (another Excel file opened), as I cannot do that with my macro. When the InputBox opens, I can only choose worksheets within my current excel file.

    TIA for your help!

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: VBA how to copy the selected range of data and paste into the new workbook via InputBo

    Switch to other workbook before calling Inputbox. Then (if needed) return to main workbook.

    PS. As a comment to other therad - while registering macro switching between workbooks is registered as Window(name).activate
    As you write a macro (or edit registered one it is better to refer to collection of open Workbooks (as I shown in http://www.excelforum.com/excel-prog...ml#post3623616 )
    Best Regards,

    Kaper

+ 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. [SOLVED] Code to copy data from a closed workbook and paste in active workbook using named range.
    By paullie1912 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-28-2014, 02:38 AM
  2. Copy selected range from email attachment and paste into closed workbook
    By Lisa4legin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2013, 09:32 AM
  3. Replies: 2
    Last Post: 05-01-2013, 05:37 AM
  4. [SOLVED] Copy selected range of data and paste in new open workbook
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-26-2013, 03:41 AM
  5. [SOLVED] Browse a File, Copy Selected data from it and paste it to other workbook (Active)
    By FCarv in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2012, 09:46 AM

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