View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
jfcby[_2_] jfcby[_2_] is offline
external usenet poster
 
Posts: 121
Default User Form texbox insert text in cell - excel 2003

Hello,

I found a code that would work!

Thank you,
jfcby


jfcby wrote:
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