+ Reply to Thread
Results 1 to 6 of 6

Cant get VBA to copy one sheet data to another!

  1. #1
    Registered User
    Join Date
    08-09-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Cant get VBA to copy one sheet data to another!

    Hi forum members,

    I have been at this macro for hours and unable to find out why it wont work, and from testing various available scripts on the internet this seems to be the fastest.

    Objective - To download and open a file from a website i.e. http://www.asx.com.au/asx/research/A...dCompanies.csv
    and on my current workbook "lets say Analysis.xlsx" worksheet "Summary" I am trying to open the downloaded file and copy information from ASXListedCompanies.csv into Summary then close ASXListedCompanies.csv and return back to the Summary worksheet. This is what I have, but it always opens the downloaded file and nothing is copied onto the Summary worksheet in the analysis workbook, please help!


    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    11-14-2010
    Location
    Macau
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Cant get VBA to copy one sheet data to another!

    Hi,
    I think you change this
    Set wnd = ActiveWindow
    to
    Set wnd = ActiveWorkbook

  3. #3
    Registered User
    Join Date
    08-09-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Cant get VBA to copy one sheet data to another!

    Thanks for that, didn't work.

    Also now getting an error "Run-time error '9':
    Subscript out of range
    for this script
    Sheets(ssheet).Cells.ClearContents

    Was working fine awhile ago even after changing activeworkbook back to activewindow!

    Regards

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Cant get VBA to copy one sheet data to another!

    Subscript out of range means the object does not exist in the collection
    for this script
    Please Login or Register  to view this content.
    Do you have a sheet named "Summary"?

  5. #5
    Registered User
    Join Date
    08-09-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Cant get VBA to copy one sheet data to another!

    Yes I do have a sheet called summary. Figure out why I was getting that error as abovementioned, but still unable to copy from workbook to workbook even using the manual recording macro.

    If anyone can help please do. Thanks.

  6. #6
    Registered User
    Join Date
    08-09-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Cant get VBA to copy one sheet data to another!

    bump, can anyone tell me why the copy sheets is not working? tried manually recording the macro for the copy and paste from one sheet to another and still does not want to work.

+ 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. Replies: 1
    Last Post: 06-05-2013, 07:03 AM
  2. Replies: 0
    Last Post: 05-21-2013, 03:09 PM
  3. Copy Data from a fixed form of data sheet into a master excel sheet.....
    By sirimhk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2012, 08:48 AM
  4. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 AM
  5. Copy Data from Multiple weekly Sheet to Monthly sheet and filter the data
    By santhoshjoseph in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-06-2012, 07:07 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