+ Reply to Thread
Results 1 to 6 of 6

Three Textbox.value enter into one cell from Userform

Hybrid View

  1. #1
    Forum Contributor ebin charles's Avatar
    Join Date
    03-31-2010
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    255

    Angry Three Textbox.value enter into one cell from Userform

    Hello,

    Please my masters,
    Help me to feed three Textbox.Value into one cell by adding 3.
    TextBox1 = ebin
    TextBox2 = excel
    TextBox3 = martin, so the result should be
    A1 cell = ebin / excel / martin
    I tried many methods to solve this, I can't move without your help.

    Regards
    charles
    Attached Files Attached Files
    Last edited by ebin charles; 06-15-2011 at 08:03 AM.

  2. #2
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Three Textbox.value enter into one cell from Userform

    try something like this:
    Range("A1").Value = TextBox1.Text & "/" & TextBox2.Text & "/" & TextBox3.Text

  3. #3
    Forum Contributor ebin charles's Avatar
    Join Date
    03-31-2010
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    255

    Re: Three Textbox.value enter into one cell from Userform

    Quote Originally Posted by mohd9876 View Post
    try something like this:
    Range("A1").Value = TextBox1.Text & "/" & TextBox2.Text & "/" & TextBox3.Text
    Thank you so much.
    It helps to enter in A1, ok,
    But when I enter next time it should be in A2, likewise it should continue
    down rows as I enter next data.

    Please help me.

    Regards
    charles

  4. #4
    Registered User
    Join Date
    04-28-2011
    Location
    Plymouth, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Three Textbox.value enter into one cell from Userform

    I'm not proud of this code but it saves the values in the textboxes when a button is clicked. Have you tried something like this? -

    Private Sub CommandButton1_Click()

    Dim T As String

    Sheets("Sheet1").Activate
    Range("A1").Select

    Task = TextBox1.Value & "/" & TextBox2.Value

    ActiveCell.Value = T

    End Sub

  5. #5
    Registered User
    Join Date
    04-28-2011
    Location
    Plymouth, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Three Textbox.value enter into one cell from Userform

    Sorry I should've checked before posting.

    If you check for a value in A1, if its NOT empty offset by 1,0 (or to move active cell to the right 0,1) until cell is empty. Then concatenate values as described above

       Sheets("Sheet1").Activate
    
    Range("A1").Select
    
     If IsEmpty(ActiveCell) = False Then
    
            ActiveCell.Offset(1, 0).Select
    
        End If
    
        Loop Until IsEmpty(ActiveCell) = True
    Last edited by markee; 06-15-2011 at 08:04 AM.

  6. #6
    Forum Contributor ebin charles's Avatar
    Join Date
    03-31-2010
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    255

    Re: Three Textbox.value enter into one cell from Userform

    Quote Originally Posted by markee View Post
    I'm not proud of this code but it saves the values in the textboxes when a button is clicked. Have you tried something like this? -

    Private Sub CommandButton1_Click()

    Dim T As String

    Sheets("Sheet1").Activate
    Range("A1").Select

    Task = TextBox1.Value & "/" & TextBox2.Value

    ActiveCell.Value = T

    End Sub
    Thank you Mohd & Markee,

    I alter Mohd code into like this

    .Cells(lRow, 1).Value = Me.cboPart.Text & "/" & cboPart1.Text & "/" & cboPart2.Text & "/" & cboPart3.Text
    Thank you once again.
    charles

+ 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