+ Reply to Thread
Results 1 to 9 of 9

Using a button to select Non-Zero values from a list and paste the results to a textbox

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Using a button to select Non-Zero values from a list and paste the results to a textbox

    Hello,
    I'm trying to create a button that when pressed will examine a set of linked specified cells (basicly a record with a name in it and the record to its right with a quantity in it, such as A4 and B4). What I want is for excel to look at each of the 'B' cells and check if they are non-zero, and if they are copy the 'B' cell and its corresponding 'A' cell to a designated Text box. i'll give an example in case my explanation isn't very clear

    Example

    Socks - 100
    shirts - 0
    glove - 0
    vest - 12
    skirt - 0
    trousers - 0

    , What I'm trying to make happen is, I press a button, and Excel would paste into the text box, (socks -100, vest - 12) with a carriage return after each pair.

    If anyone could be of any help I would greatly appreciate it. I'm not new to the basic uses of Excel but i'm totally stumped on how to even begin trying to put this together.

    Many thanks,
    Raven

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,255

    Re: Using a button to select Non-Zero values from a list and paste the results to a textbo

    Thy_Raven13,

    Which Text Box are you using? The one from the Insert tab or Developer tab on the Ribbon?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Using a button to select Non-Zero values from a list and paste the results to a textbo

    the one from the Developer tab, the AdtiveX control one was my plan, with a form control button.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,255

    Re: Using a button to select Non-Zero values from a list and paste the results to a textbo

    Hello Thy_Raven13,

    Sorry for the late reply. Is this Text Box on a worksheet or VBA UserForm?

    I assume the button will be on worksheet to call the macro, correct?

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,255

    Re: Using a button to select Non-Zero values from a list and paste the results to a textbo

    Hello Thy_Raven13,

    This macro assumes the button and the text box are both on the same worksheet. The Text Box name is "TextBox1". You may need to change this.

    Be sure to also change the Text Box Properties:
    EnterKeyBehavior = True
    Multiline = True
    WordWrap = True
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Using a button to select Non-Zero values from a list and paste the results to a textbo

    Yes I had intended the button to be in the same page as the text box. I'll give this a try out tomorrow and let you know how I get on. Thank you so very much for your time and help, I really appreciate it
    You Rock,
    Raven

  7. #7
    Registered User
    Join Date
    06-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Using a button to select Non-Zero values from a list and paste the results to a textbo

    It worked wonderfully, thank you so very much. It does exactly what I had wanted it to do. Your Ace, and your time and effort are very much appriciat

  8. #8
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: Using a button to select Non-Zero values from a list and paste the results to a textbo

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  9. #9
    Registered User
    Join Date
    06-19-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Using a button to select Non-Zero values from a list and paste the results to a textbo

    Thank you for marking my thread as solved, it was indeed, I shall make sure to do so in future. I have Added a star to Leith Ross for the amazing help

    Thanks again,
    Raven

+ 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. vba cmd button to assign for edit section of textbox values return back to acurate cell
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-26-2013, 05:01 AM
  2. Replies: 4
    Last Post: 08-28-2012, 01:27 PM
  3. Excel Macro help to copy/paste results using input values from a list box
    By kamila7 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-13-2012, 04:46 PM
  4. Userform: Pass textbox values to another textbox on button press
    By adjustermn in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2010, 11:19 PM
  5. Using VBA to autofilter and paste over results - can't select only filtered rows.
    By Cornwell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-14-2010, 11:33 AM

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