Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display contents of a cell in a user form text box -- Excel 2003 VBA hiskilini Excel Discussion (Misc queries) 7 April 4th 23 10:22 AM
can i insert a text box in a footer in excel 2003 Peekabeaux Excel Discussion (Misc queries) 1 June 14th 06 12:02 AM
How do i insert my excel user name into a cell? Grant Robertson Excel Discussion (Misc queries) 1 October 16th 05 11:03 PM
In Excel, how do I insert User Name (author) in a cell. George B. Excel Discussion (Misc queries) 3 August 23rd 05 11:46 PM
Posting text typed inside a TexBox into the worksheet cell Syed Ahmad Anas Excel Programming 2 July 30th 03 07:54 AM


All times are GMT +1. The time now is 07:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"