Novice Looking For Help

Skyhook

New Member
Joined
Apr 8, 2002
Messages
38
I have a userform with 3 text boxes. When the user clicks the command button it places the contents of the textboxes on sheet 1 (row 1 column B). What is happening is that each time the commandbutton is clicked it replaces the text already on sheet one. I need a code that will look for the last row and last column that has data and place the contents in the next empty cell and column.

Thanks in Advance
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hiya,

Could you adapt something like the following for your purposes...

Say you're filling in Column A

Sub FillDataFromTextbox

Dim Lastrow As Integer

Lastrow = Range("A65536").End(xlUp).Row

Range("A" & Lastrow + 1).Value = Userform1.Textbox1.Value

End Sub

Rgds
AJ
 
Upvote 0
I have something very similar to this. I put this code into my command button:

Columns("B:B").Insert Shift:=xlToRight
Range("A1").Select

I have code in each of my textboxes along the lines of:

Worksheets("sheet1").range("b1").value=textbox1

so that as soon as your answer goes into textbox1, it appears on your sheet. When you click the command button at the end, it inserts a row, shifting your answers to column C, archiving them
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,972
Members
448,933
Latest member
Bluedbw

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