+ Reply to Thread
Results 1 to 8 of 8

Copy paste to another sheet only once when the condition is met

  1. #1
    Registered User
    Join Date
    09-09-2019
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Copy paste to another sheet only once when the condition is met

    Hello,

    I am trying to improve a tracking a sheet that we go in once a while and update the conditions. If the condition is 1 (meaning 100) then we want to paste into the "Wins" sheet for the selected ranges. The code I have works to paste the entire data when the condition is met, but when I click on the button to update, then it updates everything all over again. I would like to have it updated only once and the next available empty row on "Wins" sheet.

    I tried two things:
    1) this one runs and copies all the data
    Please Login or Register  to view this content.
    2) This one gives me an error "Wrong number of arguments or invalid property assignment"
    Please Login or Register  to view this content.
    *********

    Can someone help me figure this out ??

    Thank you!
    ecelebi16
    Attached Files Attached Files
    Last edited by 6StringJazzer; 09-09-2019 at 10:32 AM.

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Copy paste to another sheet only once when the condition is met

    What do you want to copy to "WINS", only the last record in "IC Pipeline" or whatever is selected when you click on the button?
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Copy paste to another sheet only once when the condition is met

    Try this:
    Please Login or Register  to view this content.
    Click the * to say thanks.

  4. #4
    Registered User
    Join Date
    09-09-2019
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Copy paste to another sheet only once when the condition is met

    Hi bulinak, I have added the attachment. So you see that column D, the probability gets updated when it is a win, meaning 100. So when I hit update it should add the data at the end of the wins tab when there is potential changes. This change is random, but I want that updated data to be at the end of the wins file when there is change.

    But coding updates everything every time when I hit update.

    Thank you!

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Copy paste to another sheet only once when the condition is met

    What about forum Rules here
    2. Programming code must be enclosed in code tags to improve readability. (A, Z)
    Please Login or Register  to view this content.
    (or use the # button)

    '! No looping required...Use AutoFilter
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  6. #6
    Registered User
    Join Date
    09-09-2019
    Location
    USA
    MS-Off Ver
    2016
    Posts
    3

    Re: Copy paste to another sheet only once when the condition is met

    Hi PaulM100 , thanks for your response. I used your coding and it does the same thing.. When I go back for the second time, it updates the entire list again.. I only need to have it update it once the probability turns to 1. I attached my excel if you want to take a look at it.

    Thank you!

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Copy paste to another sheet only once when the condition is met

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. I have also noted that you ignored sintek's post about this. In the future that can earn warnings. --6StringJazzer
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  8. #8
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Copy paste to another sheet only once when the condition is met

    Then you don't need a button, you need it to trigger automatically on cell change. Right click on IC pipeline tab - view code and insert the following code:
    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. How to use a For Loop to copy and paste to another sheet based on condition?
    By maym in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-15-2018, 10:31 PM
  2. [SOLVED] IF condition copy paste Range(ActiveCell.Offset(,) in new sheet
    By incobart in forum Excel Programming / VBA / Macros
    Replies: 43
    Last Post: 07-13-2017, 06:39 AM
  3. [SOLVED] Copy and paste (values) to another sheet based on condition
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-09-2013, 10:25 PM
  4. Replies: 1
    Last Post: 09-17-2013, 01:38 PM
  5. Macro to copy from one sheet and paste in another if a condition is met.
    By dlholland1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-29-2013, 09:41 AM
  6. [SOLVED] Code to copy and paste a row into another sheet of the workbook when a condition is met.
    By oldboots in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2013, 03:03 AM
  7. Copy/Paste from one sheet to another based on condition
    By TheTempest in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-16-2010, 01:13 PM

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