+ Reply to Thread
Results 1 to 4 of 4

Macro code error: code is near complete

  1. #1
    Registered User
    Join Date
    12-06-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Macro code error: code is near complete

    Hi, I have written a macro code as below, however, there seems to be an error.

    I am trying to select all rows in sheet 1 with an X in column E to have their respective columns F, G, H & I to be copied and pasted into sheet 2 starting with cell A1, but sheet 2 should not contain any blank rows.

    Can anyone pls help to fine tune the macro?

    Many thanks.


    Please Login or Register  to view this content.
    Last edited by kashshaikh; 12-11-2011 at 10:02 PM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Macro code error: code is near complete

    Forum rules require VBA code to be wrapped in code tags.

    Please edit your post to add the tags.

    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code]

    Why not apply an auto filter to the column and copy all of the visible rows in one go?
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    12-06-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Macro code error: code is near complete

    Hi, I have written a macro code as below, however, there seems to be an error.

    I am trying to select all rows in sheet 1 with an X in column E to have their respective columns F, G, H & I to be copied and pasted into sheet 2 starting with cell A1, but sheet 2 should not contain any blank rows.

    Can anyone pls help to fine tune the macro?

    Many thanks.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Macro code error: code is near complete

    Basic code - using autofilter, which is more efficient than looping.

    Try it on a back up copy first.

    Please Login or Register  to view this content.
    Sheet references are to sheet code names. Adjust them as required.

+ 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