command button code needed

P

pswanie

i got the following code with a command button (thanx dan r.) it does put
the text that i enterd in the apropriate cells. so that part works. thanx

but now...
im thinking of adding a checkbox1. textbox1, textbox2 and textbox3 only
needs be visible when the tickbox1 has a tick in..

and if the commandbutton1 can close the userform aswell?

thanx

Private Sub CommandButton1_Click()
Dim lRow As Long, i As Integer
For i = 3 To 5
lRow = Cells(Rows.Count, i).End(xlUp).Row
Cells(lRow + 1, i) = Me.Controls("TextBox" & i - 2).Value
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top