+ Reply to Thread
Results 1 to 7 of 7

Macro for copy paste in a collection

  1. #1
    Registered User
    Join Date
    03-12-2014
    Location
    Denver
    MS-Off Ver
    Excel 2010
    Posts
    4

    Macro for copy paste in a collection

    Please help me write a macro that will perform the following:

    For every worksheets in workbook "book1.xls",

    Copy the row where a cell in column k has any value that is not blank

    Copy that row and paste it to workbook2's worksheet1.

    Thank you in advance for helping!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,744

    Re: Macro for copy paste in a collection

    What have you attempted so far? Show us your in progress code so that it can be amended as necessary.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    03-12-2014
    Location
    Denver
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro for copy paste in a collection

    I am a newbie to VBA.. but here goes:


    Please Login or Register  to view this content.
    Last edited by alansidman; 03-13-2014 at 01:12 PM.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,744

    Re: Macro for copy paste in a collection

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,744

    Re: Macro for copy paste in a collection

    Give this a try:

    Please Login or Register  to view this content.
    Please note that this has not been tested on data as you did not supply a sample workbook.

  6. #6
    Registered User
    Join Date
    03-12-2014
    Location
    Denver
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro for copy paste in a collection

    I apologize for not ready the forum rules prior to posting

    I will make sure to follow them going forward. Thank you for the kind notice!

    I tried to run your script but received run-time error 438: Object doesn't support this property or method. No worries though because I had some help and the solution to my problem is below:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-12-2014
    Location
    Denver
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro for copy paste in a collection

    Actually, this is the code that works. The above code was missing a couple things.

    Please Login or Register  to view this content.

+ 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] Performance of iteration through Words collection degrades as collection gets bigger
    By 6StringJazzer in forum Word Programming / VBA / Macros
    Replies: 7
    Last Post: 01-14-2014, 09:44 AM
  2. Copy & paste in macro doesn't paste all cells
    By pltrapper in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-13-2013, 09:22 AM
  3. [SOLVED] Simple copy and paste macro- Paste special help needed.
    By hernancrespo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2012, 07:02 AM
  4. 2 Macro's: only vertical copy/paste action and copy-paste 14 columns to the right.
    By vdongen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-08-2010, 10:34 AM
  5. Copy and Paste macro needs to paste to a changing cell reference
    By loulou in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2005, 07:06 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