+ Reply to Thread
Results 1 to 30 of 30

Button click, cut and paste into another spreadsheet data that was filtered

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    I have a code to filter data by an ActiveX textbox.
    works well, but need a adatção.

    I would use a button that when clicked, the line would be filtered cut and pasted into another tab.


    Big File in: http://www.sendspace.com/file/nis5zh
    Please Login or Register  to view this content.
    thank you!
    Last edited by marreco; 10-14-2012 at 08:11 PM.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    Any idea?

    Thank you!!!

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi

    How about something like

    Please Login or Register  to view this content.
    rylo

  4. #4
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    lacked a description must be re-cut line, not copied
    can you do this?
    thank you!

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi

    1) Change the copy to cut.
    2) what do you mean by lacked a description?

    rylo

  6. #6
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.
    I tried using the 'Cut' but generated this error
    Run-time error '1004 ':
    The chosen command can not be performed with multiple selections.
    Just select a range and click the command again.
    There is another way to eliminate the row that was copied?

  7. #7
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi

    Ok go back to the original copy line and then add a row delete option.
    Please Login or Register  to view this content.
    See if that does it.

    rylo

  8. #8
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.
    generated this error
    Runtime Error '9 ':
    subscript out of range
    Thank you!!!

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi Marreco,

    What should we name the Tab and is it in the same book?
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  10. #10
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    See file...
    http://www.sendspace.com/file/s7j56g

    Thank you!!

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi Marreco,

    I would use a button that when clicked, the line would be filtered cut and pasted into another tab.
    There's no button on the new file ????

  12. #12
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    I had the attachment problem and had to send a new one.

    but would the tab button 'Devolução - Total & Parcial'

    the code posted by: rylo ok, but I need the copied data is removed from the guide 'Devolução - Total & Parcial'

  13. #13
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi Marreco,

    Do you want the extractions all on the same sheet or do you want a sheet for each extraction - if you want the latter:

    This code goes in a module:

    Please Login or Register  to view this content.
    And the other code stays in the sheet.

  14. #14
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    In my example, will always be a filtered line, that line should be re-cut the sheet 'Devolução - Total & Parcial' to the worksheet 'Sheet1'

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi Marreco,

    You just want one tab - do you want to put more than one "cutting" on it?

    Just remove the naming part from the code I sent you:

    From this:
    Please Login or Register  to view this content.
    To this:
    Please Login or Register  to view this content.

  16. #16
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    It turns out that your code is not sending the finger to another tab

    Thank you!!!

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi,

    Which book did you use? My code works on the first one????????

  18. #18
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    Please Login or Register  to view this content.
    When you enter the code in ActiveX Textbox.
    A line will be filtered in the worksheet 'Devolução - Total & Parcial' I need a code that after filtering the line is re-cut to the worksheet 'Sheet1'

  19. #19
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi Marreco,

    Try this (all in the source sheet)

    Please Login or Register  to view this content.
    Last edited by xladept; 10-13-2012 at 08:31 PM.

  20. #20
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi,
    Textbox while typing in the number '600150560 'the row that number has to go to another worksheet.
    If I click there goes correctly, is correct?


    When I press the 'Enter' key, which is another number that goes to another worksheet.
    Another thing, the data must stay one beneath the other, if I filter another number the old data from Sheet1 disappears, and again sits atop the old.

  21. #21
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Try it again - I just re-edited the last post!

  22. #22
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.
    When running is giving the following error:
    Runtime Error '9 ':
    Subscript form interval
    This line
    Please Login or Register  to view this content.
    Thank you!!

  23. #23
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi..


    When running is giving the following error:
    Runtime Error '9 ':
    Subscript form interval
    This line

    Do: i = i + 1:
    Thank you!!

  24. #24
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi

    Try this on on the original post attachement.

    Please Login or Register  to view this content.
    rylo

  25. #25
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.
    I had to change so now is the way I need.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    How do I put a msgbox if the users decide not enviaar the data to another tab?
    See what I tried but it did not work!
    Please Login or Register  to view this content.
    Thank you!!

  26. #26
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi

    Try a syntax like

    Please Login or Register  to view this content.
    rylo

  27. #27
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    I'm try this
    Please Login or Register  to view this content.
    But....
    Compile error:
    Invalid use of the word Key, Me

  28. #28
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi

    Just where and how are you invoking this code? I figured you must have decided to put things into a form somewhere as you were using the me construct.

    rylo

  29. #29
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi.

    If I remove "Me.TextBox1.Value" the code works.

    Otherwise generates the error!

    Thaks for all!!!

  30. #30
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Button click, cut and paste into another spreadsheet data that was filtered

    Hi Marreco,

    I guess you've got it solved - but, this works nicely - I replaced the Lost Focus with a Change event and now you need to hit the enter button for it to trigger:

    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)

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