TextBox Value Transfer in worksheets

nidhipatel

Board Regular
Joined
Feb 11, 2017
Messages
52
my userform contain 7 Textbox i would like This 7 Textbox value Transfer in Worksheet1 In "D" Column. every time data transfer in last blank cell in D Columun
with vba macro
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
This script will do what you want and enter data into active sheet.
If you need it added to another sheet I need sheet name.
I did not understand:
Worksheet1

Did you mean Sheet(1)
Or sheet named
Sheet1

Code:
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
'Modified  9/14/2018  5:04:16 PM  EDT
Dim i As Long
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "D").End(xlUp).Row + 1
Dim ctrl As Control
    For i = 1 To 7
        Cells(Lastrow, "D").Value = Me.Controls("TextBox" & i).Value
        Me.Controls("TextBox" & i).Value = ""
        Lastrow = Lastrow + 1
        Next
    
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,601
Messages
6,125,763
Members
449,259
Latest member
rehanahmadawan

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