+ Reply to Thread
Results 1 to 6 of 6

copy only visible text boxes to clipboard from user form

  1. #1
    Registered User
    Join Date
    05-11-2014
    MS-Off Ver
    Excel 2003
    Posts
    36

    copy only visible text boxes to clipboard from user form

    hi all

    i have been stuck on this for a while now. i have created a command button that copies a string to clip board. this strings is made up of text boxes on a user form. the text boxes are filled in by the user but depending on the users input some remain hidden. when i copy to clip board the hidden text boxes leave blank gaps . is there any way to get these removed so when pasted the hidden text boxes dont leave a gap. Heres my code. thank you so much in advance for your help

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: copy only visible text boxes to clipboard from user form

    This should work. You'll have to make a Case for each control, adding the additional line feeds and spaces as required.

    Please Login or Register  to view this content.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    05-11-2014
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: copy only visible text boxes to clipboard from user form

    hi Tinbendr

    Thanks for the quick response. Unforunately that code seems to just take the A0 box and repeatedly copies it and no others.

    Any Ideas?

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: copy only visible text boxes to clipboard from user form

    Hmmm, yes, you're right.

    Perhaps
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-11-2014
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: copy only visible text boxes to clipboard from user form

    hi Tinbendr

    you'll have to forgive me here. i Am quite new to VBA. i have altered the code as you suggested and it is still copying hidden text boxes

    heres the code i am using

    Please Login or Register  to view this content.
    thanks for your help

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: copy only visible text boxes to clipboard from user form

    Ha! No. Like this
    Please Login or Register  to view this content.
    You have to fill the rest of the Case Statements for each Textbox since you seem to have different spaces and line feeds between different textboxes.

    If you have the same pattern, then they can go on the the Case line separated by a comma.

    I create an array with all the names of the controls. I, then, iterate through the list, testing for Visible in each control name.

    If you still can't get it, upload a sample sheet with the userform.

+ 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. copy to clip board only visible text boxes from user form
    By brewsi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-26-2014, 03:56 PM
  2. Correct vba code for text boxes in user form
    By newqueen in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-27-2013, 09:38 PM
  3. Text field visible property on user form
    By JChandler22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-22-2010, 02:44 PM
  4. User Form Basics - Populating Text Boxes
    By T.J. Lanza in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-24-2009, 03:48 AM
  5. User form and text boxes on charts
    By Joel Mills in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2005, 06:05 PM

Tags for this Thread

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