+ Reply to Thread
Results 1 to 11 of 11

Concatenating with text boxes

  1. #1
    Registered User
    Join Date
    03-07-2017
    Location
    Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Concatenating with text boxes

    Okay, so I'm trying to have cells that display like "3X + 2C + 5B." I'm able to do that, but I'm having trouble displaying the cell, when X, C, or B = 0 or "". So, instead of getting say "X + 6B," I get "X + C + 6B." I understand why the "C" is still displaying, but I don't know how to get rid of it. Can anyone help me? Thank you.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by cluelessdood; 03-07-2017 at 05:42 PM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Concatenating with text boxes

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED, scroll down and click Manage Attachments.

    PS Can you please add code tags when posting code?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    03-07-2017
    Location
    Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Concatenating with text boxes

    Whoops! Sorry about that! I just edited my post now.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Concatenating with text boxes

    No problem, just makes things easier to help.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Concatenating with text boxes

    Give this a try.

    Please Login or Register  to view this content.
    Last edited by bakerman2; 03-07-2017 at 08:00 PM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Concatenating with text boxes

    cluelessdood
    Try
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-07-2017
    Location
    Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Concatenating with text boxes

    Quote Originally Posted by jindon View Post
    cluelessdood
    Try
    Please Login or Register  to view this content.
    Quote Originally Posted by bakerman2 View Post
    Give this a try.

    Please Login or Register  to view this content.
    Both of these worked perfect! Thanks very much!

    I had one other question, but wasn't sure if I should make a completely new thread. Is it possible, when a populated cell is clicked, that the numbers previously entered would already be displayed? It would be used for editing purposes. Thanks.
    Last edited by cluelessdood; 03-08-2017 at 10:12 AM.

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Concatenating with text boxes

    Probably can be done more elegantly but this seems to work.

    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: Concatenating with text boxes

    Add to the Userform code module
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    03-07-2017
    Location
    Texas
    MS-Off Ver
    Office 2016
    Posts
    39

    Re: Concatenating with text boxes

    Thanks again! Both worked great. How did you guys learn to be so good with VBA? I'd love to be able to advance my skills.

  11. #11
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Concatenating with text boxes

    You're welcome and thanks for rep+.

+ 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. Using List boxes and text boxes with complex data sets
    By Mlanger575 in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 11-06-2016, 01:11 PM
  2. Lossing Chart Boxes/ Text boxes when close file
    By david2003 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-05-2014, 09:39 AM
  3. [SOLVED] Clear all text boxes-combo boxes in a userform.
    By MariaPap in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2014, 11:16 AM
  4. [SOLVED] Help with code for userform text boxes, combo boxes and excel
    By innerise in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2014, 09:07 AM
  5. Concatenating numbers as text and retaining text format
    By Excel_vba in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-19-2014, 10:14 PM
  6. [SOLVED] Text Boxes: Insert/Text Box vs. Developer Text Boxes
    By snapfade in forum Excel General
    Replies: 5
    Last Post: 10-09-2012, 01:45 AM
  7. Replies: 2
    Last Post: 02-19-2010, 03:55 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