User Form texbox insert text in cell - excel 2003

  • Thread starter Thread starter jfcby
  • Start date Start date
J

jfcby

Hello,

I've created a user form with 3 text boxes. I can't get the text boxes
to insert data into cells.

Here is my code:

Private Sub CommandButton1_Click()

'Find blank cell
Dim rngBlank As Range
Set rngBlank = Range("A5:A20").Find("")
If rngBlank Is Nothing Then
MsgBox "No cell found"
Else

'Insert data in blank cell
rngBlank.Offset(1, 0).Value = TextBox1.Text
rngBlank.Offset(1, 1).Value = TextBox2.Text
rngBlank.Offset(1, 2).Value = TextBox3.Text

End If
Unload UserForm1

End Sub

How can this code be modified to add text begining with A5, then find
the next blank cell insert data through 20?

Thanks for your help,
jfcby
 

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

Back
Top