+ Reply to Thread
Results 1 to 4 of 4

How to write the content of two different TextBox in one cell in excel sheet

  1. #1
    Registered User
    Join Date
    04-17-2013
    Location
    Tunisia
    MS-Off Ver
    Excel 2010
    Posts
    13

    Red face How to write the content of two different TextBox in one cell in excel sheet

    Hello everybody
    I know this could be trivial to some of you, but since I am a beginner I couldn't know how to do this.
    Usually when I do want to write the content of one TextBox in an excel sheet I use this code:
    Sheets("sheet1").Range("A3").Value = TextBox1.Value

    but what if I want to write the content of two TextBox and add some characters in the same cell.
    For example in the first TextBox the user put "mariem" in the second one he put "radhouen" (which is my name by the way)
    then in the cell there must be written: "Your name is mariem radhouen"
    Thank you

  2. #2
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: How to write the content of two different TextBox in one cell in excel sheet

    Hi radhouen,

    Try below code and see the attached sample workbook.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Cheers,

    Joshi
    Being with a winner makes you a winner

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: How to write the content of two different TextBox in one cell in excel sheet

    Use ampersand (&) to collate/join the different elements together.

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: How to write the content of two different TextBox in one cell in excel sheet

    Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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