+ Reply to Thread
Results 1 to 7 of 7

Help with a Macro-Paste method of worksheet class failed run time error 1004

  1. #1
    Registered User
    Join Date
    08-10-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    8

    Help with a Macro-Paste method of worksheet class failed run time error 1004

    ' MacroH Macro
    ' Macro recorded 8/9/2011 by gmcneill
    Please Login or Register  to view this content.

    The last part is the problem that is in red----ActiveSheet.Paste

    Thank you for your help
    Last edited by mcneill_garr; 08-10-2011 at 11:55 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Help with a Macro-Paste method of worksheet class failed run time error 1004

    Welcome to the forum.

    Please take a few moments to read the forum rules and add CODE tags to your code sample.

    In the meantime, lose all the scrolling, it adds nothing to the code.

    It's probably the filtering that's killing it. You can't really do much between the copy and paste other than move around the worksheet/workbook.

    If you must copy then filter, save the data in a variable, then locate where you want it and "paste" the data in the variable.

    You can probably get away with:

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    08-10-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Help with a Macro-Paste method of worksheet class failed run time error 1004

    Ok- Thank you for your reply

    I need the scrolling in order to copy it at another point on the page correct? I am using an autofilter then copying data, to then copy to another area that I want to make a macro for each time.

    For example, I have about 10 rows of info one month, 3 the next, 15 the next, and I need to make a macro to copy and paste each one if the number changes and copy to another point on the excel spreadsheet.

    Thank you

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Help with a Macro-Paste method of worksheet class failed run time error 1004

    No, The scrolling is simply a reflection of the mouse clicks on the scroll bar when you were recording the macro. If you'd clicked and held the scroller, you'd have got something different.

    You only "need" the selects but, in actual fact, you don't need those either.

    You would be better posting a sample workbook and explaining a number of scenarios; what you do and what you expect the outcome to be.

    Regards

  5. #5
    Registered User
    Join Date
    08-10-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Help with a Macro-Paste method of worksheet class failed run time error 1004

    Thank you again for the reponse- I am somewhat new to excel so I struggle to explain it as well.

    I have a large excel spreadsheet, with a column that I copy and paste in with changing rows each month. It is a spreadsheet or projects listed as Active, Pending, or Completed-

    I am creating a macro so that the macro will copy and paste the projects based on their status and paste them somewhere else. The problem may stem from the autofilter because when I go to copy it it goes rows 1-52 and then rows 420 and up. It is a very large sheet.

    The number of projects in each status change month to month, so instead of constantly sorting I want a macro to copy/paste.

    Thank you

  6. #6
    Registered User
    Join Date
    08-10-2011
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Help with a Macro-Paste method of worksheet class failed run time error 1004

    When i put on the autofilter it hides hundreds of rows, even the blank ones outside the chart----can i fix this?

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Help with a Macro-Paste method of worksheet class failed run time error 1004

    Last chance ;-) Please post a sample workbook ... it's a lot easier to assess, and ask sensible questions, when you know what you're working with.

    It only needs to be a relatively small, but representative sample of the data. If you then explain what you want to filter on, and where you want it putting, I'm sure it will be straightforward.

    I'm not planning on doing any work on a hypothetical solution to a hypothetical problem and then entering into a long discussion about how and why it doesn't work with your live data.

    Regards

+ 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