Adding user input to a table

cainey1991

New Member
Joined
Feb 20, 2014
Messages
31
Hi all,

I have created a user input form and I would like it so that when the user clicks the Save button of the form the details from that form are inputted to the bottom of a populated table

Example of user input text field names:
name
age
height

table name = table1

Any help would be greatly appreciated.

D
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
.
.

Try something like this:

Code:
Private Sub CommandButton_Save_Click()

    Dim NextCell As Range
    
    With ThisWorkbook.Worksheets("Sheet1")  'amend sheet reference accordingly
        Set NextCell = .Range("A" & .Rows.Count).End(xlUp).Offset(1, 0) 'get next empty cell in column A
    End With
    
    With NextCell   'assign text box values to empty cell and adjacent cells
        .Offset(0, 0).Value = TextBox_Name.Value
        .Offset(0, 1).Value = TextBox_Age.Value
        .Offset(0, 2).Value = TextBox_Height.Value
    End With
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,770
Messages
6,126,794
Members
449,337
Latest member
BBV123

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top