+ Reply to Thread
Results 1 to 2 of 2

Saving multiple textboxes in one cell

  1. #1
    Registered User
    Join Date
    01-25-2017
    Location
    USA, Edwardsville
    MS-Off Ver
    10
    Posts
    4

    Question Saving multiple textboxes in one cell

    Hi,

    I want users to be able to write data in several textboxes in one userform and then I want all of them to be saved in one cell by using "/". My current code is the following but I want to add TextBox13 and TextBox16 to the same cell as TextBox12.

    Thank you in advance!

    Private Sub CommandButton1_Click()
    'Copy input values to sheet.
    Dim lRow As Long
    Dim ws As Worksheet
    Set ws = Worksheets("5")
    lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    With ws
    .Cells(lRow, 1).Value = Me.TextBox1.Value
    .Cells(lRow, 2).Value = Me.TextBox2.Value
    .Cells(lRow, 3).Value = Me.TextBox3.Value
    .Cells(lRow, 4).Value = Me.TextBox4.Value
    .Cells(lRow, 5).Value = Me.TextBox5.Value
    .Cells(lRow, 6).Value = Me.TextBox6.Value
    .Cells(lRow, 7).Value = Me.TextBox7.Value
    .Cells(lRow, 8).Value = Me.TextBox8.Value
    .Cells(lRow, 9).Value = Me.TextBox9.Value
    .Cells(lRow, 10).Value = Me.TextBox10.Value
    .Cells(lRow, 11).Value = Me.TextBox11.Value
    .Cells(lRow, 12).Value = Me.TextBox12.Value


    End With

    'Clear input controls.
    Me.TextBox1.Value = ""
    Me.TextBox2.Value = ""
    Me.TextBox3.Value = ""
    Me.TextBox4.Value = ""
    Me.TextBox5.Value = ""
    Me.TextBox6.Value = ""
    Me.TextBox7.Value = ""
    Me.TextBox8.Value = ""
    Me.TextBox9.Value = ""
    Me.TextBox10.Value = ""
    Me.TextBox11.Value = ""
    Me.TextBox12.Value = ""

  2. #2
    Forum Contributor
    Join Date
    11-28-2013
    Location
    Ljubljana
    MS-Off Ver
    Office 365
    Posts
    1,054

    Re: Saving multiple textboxes in one cell

    Hope the following code can help you
    Please Login or Register  to view this content.

+ 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. Paste copied cell range into multiple userform textboxes
    By c00ly81 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-11-2021, 01:30 PM
  2. [SOLVED] Select all text in textboxes when i click textboxes in simple way
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2017, 03:27 AM
  3. Changing the size of multiple textboxes using a cell value
    By Goldbadger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2015, 03:17 AM
  4. Sum or average of multiple textboxes in a cell
    By 10M in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2015, 07:48 AM
  5. Replies: 0
    Last Post: 02-04-2015, 03:46 PM
  6. [SOLVED] Looping through cell ranges in multiple worksheets and prevent saving if cell value empty
    By Spritz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-22-2013, 11:24 AM
  7. Code to prevent userform from saving duplicates based on 3 textboxes
    By Zygoid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2013, 11:04 AM

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