ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User Form texbox insert text in cell - excel 2003 (https://www.excelbanter.com/excel-programming/374971-user-form-texbox-insert-text-cell-excel-2003-a.html)

jfcby[_2_]

User Form texbox insert text in cell - excel 2003
 
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


jfcby[_2_]

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




All times are GMT +1. The time now is 10:29 AM.

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