+ Reply to Thread
Results 1 to 9 of 9

Copy and Insert row if any cell or row is selected

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    65

    Copy and Insert row if any cell or row is selected

    Hi There,

    If any row or cell is selected I want to copy that specific rows and insert the copied row below and highlight the inserted row in any color say yellow.

    I have the code which prompt a msg bot and insert the row if any row or cell is highlighted but it fills the data NOT Copying the data.

    PFA the sample file to see what I mean...the file have the code too.

    Can anyone help and advice to achieve this?

    Thanks in advance.
    Su.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy and Insert row if any cell or row is selected

    Please Login or Register  to view this content.
    Last edited by patel45; 11-01-2012 at 02:02 PM.
    If solved remember to mark Thread as solved

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy and Insert row if any cell or row is selected

    Hi macrofan

    This is my sense of what you wish to do
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    09-28-2012
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Copy and Insert row if any cell or row is selected

    Hi John,

    Thanks very much for the code.

    That's work perfectly what I'm expecting. This inserts the copied row.

    Need one more help...how can I highlight the row that is inserted so that I can know this is the row that's inserted.

    Thanks,
    Su.

  5. #5
    Registered User
    Join Date
    09-28-2012
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Copy and Insert row if any cell or row is selected

    Hi Patel,

    Thanks for your code. The code you gave, insert a row and fill the data what I needed is insert row with copied data.

    For eg: If my highlighted row has data 8 Red 4588 66667
    the code fills the data...like below 9 Red 4589 66668
    but I want the data to be copied eg: 8 Red 4588 66667

    John has given the code which does what I want.

    Thanks,
    Su.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy and Insert row if any cell or row is selected

    Hi Su

    Add the line of code indicated
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy and Insert row if any cell or row is selected

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-28-2012
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    65

    Re: Copy and Insert row if any cell or row is selected

    Many many thanks John. Works like a charm.

    Regards,
    Su.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Copy and Insert row if any cell or row is selected

    You're welcome Su...glad I could help. Thanks for the Rep.

+ 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