+ Reply to Thread
Results 1 to 8 of 8

How do I Copy certain data to another sheet-automatically

  1. #1
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    How do I Copy certain data to another sheet-automatically

    OK so I have this piece of code that will, when a command button is pushed trawl thru my sheet and copy and paste all completed actions to another sheet. But...it'll only work when the button is pushed and when the button is pushed some days later the same info is copied and pasted along with new info.
    So can someone add to my bit of code another bit of code that will clear the 'Completed cases' page prior to pasting the new data and a piece of code that will do all this when a new completed case is inputted in into 'Cases by case number' page please.
    Thanks in advance
    As below

    Please Login or Register  to view this content.
    Last edited by scrumpyjack; 01-25-2013 at 03:20 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How do I Copy certain data to another sheet-automatically

    This will copy just the one row when the user sets column R to "completed". It pastes the one row to the bottom of the data on the Completed cases worksheet.

    Put this in the same location as your CommandButton1_Click procedure. You could delete that procedure (and the button) if this works for you.
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: How do I Copy certain data to another sheet-automatically

    this will be activated when a cell value is changed but executed only when a cell in column 18 is changed

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: How do I Copy certain data to another sheet-automatically

    Alpha Frog..thanks mate works a treat.
    Hope the weather in Florida is better than the rubbish here!!
    Fred

  5. #5
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: How do I Copy certain data to another sheet-automatically

    Alpha Frog is there a PartRow command I can use to only copy certain cells from the completed case row? ie I only need certain data from the case to be in the completed case sheet.
    Thanks Fred

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How do I Copy certain data to another sheet-automatically

    Quote Originally Posted by scrumpyjack View Post
    Alpha Frog is there a PartRow command I can use to only copy certain cells from the completed case row? ie I only need certain data from the case to be in the completed case sheet.
    Thanks Fred
    There are different methods to define part of a row depending on your requirements. This is one example to copy from A to G based on the Target cell which in your case is R

    Range("A" & Target.Row & ":G" & Target.Row).Copy _

  7. #7
    Registered User
    Join Date
    01-23-2013
    Location
    Cornwall
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: How do I Copy certain data to another sheet-automatically

    Cheers AlphaFrog
    Understand that. Works a treat but...
    What if I just wanted cells A, J and K for example?

  8. #8
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How do I Copy certain data to another sheet-automatically

    Quote Originally Posted by scrumpyjack View Post
    Cheers AlphaFrog
    Understand that. Works a treat but...
    What if I just wanted cells A, J and K for example?
    Intersect(Range("A:A,J:K"), Target.EntireRow).Copy _

+ 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