+ Reply to Thread
Results 1 to 5 of 5

Limit the number of rows that get copied.

  1. #1
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Talking Limit the number of rows that get copied.

    Hello!

    This code copies the values from selected rows of Sheet1 to another sheet ("Labels")

    If the Labels destination row is 14 or greater, I don't want the copy operation to work.

    What is the best way to modify this code to do that? Maybe even a message box that says "You already have 12 labels prepared on the Label sheet."?

    Please Login or Register  to view this content.
    I appreciate the help!

    Respectfully,

    Lost
    Last edited by leaning; 08-12-2011 at 04:29 PM. Reason: Solved!!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Limit the number of rows that get copied.

    Maybe this:

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 08-10-2011 at 06:25 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Re: Limit the number of rows that get copied.

    Sir,

    With your code, Row 2 on Sheet1 is being copied to Row 2 on Labels.
    Row 3 on Sheet1 is being copied to Row 4 on Labels.
    Row 4 on Sheet1 is being copied to Row 6 on Labels.

    (It is copying the rows over, but inserting an empty row in-between.)

    Any ideas on how to fix this?

    Respectfully,

    Lost

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Limit the number of rows that get copied.

    My apologies, this is fixed above:
    Please Login or Register  to view this content.

    The part in red shouldn't be there.
    Last edited by JBeaucaire; 08-12-2011 at 05:04 PM.

  5. #5
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2003/2007/2010/2016
    Posts
    432

    Talking Re: Limit the number of rows that get copied.

    Sir,

    No need to apologize. The help you provide is always on-point and makes life easier for everyone.

    Holds true for this problem. Your code works great!

    Thanks,Jerry!

    Respectfully,

    Lost

+ 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