+ Reply to Thread
Results 1 to 6 of 6

Simple Copy/Paste work with Control Button but not for Command Button

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    763

    Simple Copy/Paste work with Control Button but not for Command Button

    Hello ALL,
    I have below simple code that work with Control Button but not for Command Button (ActiveX Control). Please help me how to make it work with Command Button (ActiveX Control)

    Please Login or Register  to view this content.
    Regards,
    tt3

  2. #2
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Simple Copy/Paste work with Control Button but not for Command Button

    What do you mean by "doesn't work"? Could you be more specific?

    Perhaps attach a sample workbook too so we can see the issue in context.

    Beth.

  3. #3
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    763

    Re: Simple Copy/Paste work with Control Button but not for Command Button

    Hi,
    That code work with Control Button but show error message when I use with Command Button (ActiveX Control)

    Error message: "Application-defined or object-defined error"

    ***Please help me with a code to work with Command Button (ActiveX Control). I want copy text from TEXTBOX from sheet "CheckIn" to last cell of column A in sheet "Data"

    Regards,
    tt3
    Last edited by tuongtu3; 12-07-2019 at 05:16 PM.

  4. #4
    Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    185

    Re: Simple Copy/Paste work with Control Button but not for Command Button

    Hi,

    If you added a commandbutton with the name CommandButton1 this should work
    but also there has to be a textbox on the "checkIn" sheet with the name "TEXTBOXNAME"


    Please Login or Register  to view this content.
    grtz
    Last edited by Joske920; 12-07-2019 at 05:12 PM.
    Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
    If you have been helped, maybe you could click the *

  5. #5
    Forum Contributor
    Join Date
    08-14-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    763

    Re: Simple Copy/Paste work with Control Button but not for Command Button

    @Joske950:
    Got error at this line:
    Sheets("Data").Range("A" & Lr + 1).Value = Sheets("CheckIn").TEXTBOXNAME.Value
    Attached Files Attached Files
    Last edited by tuongtu3; 12-07-2019 at 05:22 PM. Reason: Added sample

  6. #6
    Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    185

    Re: Simple Copy/Paste work with Control Button but not for Command Button

    hi,

    try this
    but be sure there is never a empty cell in your data on column A or 1

    Please Login or Register  to view this content.
    your Lr got the number of the last cell +1 and that gave the error
    Last edited by Joske920; 12-07-2019 at 05:39 PM.

+ 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. Replies: 1
    Last Post: 02-27-2017, 09:17 AM
  2. [SOLVED] Command Button Copy And Paste
    By underwater24 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-27-2016, 10:37 AM
  3. Command button and VBA - copy and paste
    By Cheesecake07 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2016, 11:08 PM
  4. [SOLVED] selective copy and paste via command button vba
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-28-2014, 12:07 PM
  5. copy cell value with addition of desired number with command button control
    By mubashar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2014, 01:33 PM
  6. Copy and Paste as Values using Command Button
    By macky1730 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-04-2013, 02:18 AM
  7. [SOLVED] Simple Copy and Paste Command Button
    By j_gideon in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-25-2013, 02:38 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