ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   link textbox to cell (https://www.excelbanter.com/excel-programming/405552-link-textbox-cell.html)

pswanie

link textbox to cell
 
i got textbox1 thru textbox7 on a userform. when a user click commandbutton3
the info from textbox1 must go in the next open cell in column n
textbox2 must go in the next open cell in column m
textbox3 must go in the next open cell in column o
etc..

thanx

Phillip

JLGWhiz

link textbox to cell
 
Nothing fancy, but it should work.

Private Sub CommandButton3_Click()
Lr1 = Cells(Rows.Count, 14).End(xlUp).Row
Lr2 = Cells(Rows.Count, 13).End(xlUp).Row
Lr3 = Cells(Rows.Count, 15).End(xlUp).Row
On Error GoTo ErrHndl:
Range("N" & Lr1) = TextBox1.Text
Range("M" & Lr2) = TextBox2.Text
Range("O" & Lr3) = TextBox3.Text
ErrHndl:
If Err.Number < 0 Then
MsgBox "No Text"
End If
End Sub

"pswanie" wrote:

i got textbox1 thru textbox7 on a userform. when a user click commandbutton3
the info from textbox1 must go in the next open cell in column n
textbox2 must go in the next open cell in column m
textbox3 must go in the next open cell in column o
etc..

thanx

Phillip



All times are GMT +1. The time now is 02:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com