Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Filling Cells from Textboxes

Hi everyone,
I am trying to fill about 12 cells from 12 textboxes and for some reason my
code does not work. I know it has to do with the 'Textboxi.Value' but how
else can I do this?

Dim i As Integer
For i = 4 To 15
emptyCell2.Offset(0, i) = TextBoxi.Value
Next i
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Filling Cells from Textboxes

Hi

There is no textbox collection like that anymore. You are better off with
long boring code like

emptyCell2.Offset(0, 4).Value = TextBox4.Text
emptyCell2.Offset(0, 5).Value = TextBox5.Text
emptyCell2.Offset(0, 6).Value = TextBox6.Text
emptyCell2.Offset(0, 7).Value = TextBox7.Text
emptyCell2.Offset(0, 8).Value = TextBox8.Text
' and so on

no fun to write, but runs fast and no-nonsense, and once it's written it's
done. Any loop technique will be either slower, more awkward to execute or
more memory consuming. A high price for a little less coding.

HTH. Best wishes Harald

"trini" skrev i melding
...
Hi everyone,
I am trying to fill about 12 cells from 12 textboxes and for some reason

my
code does not work. I know it has to do with the 'Textboxi.Value' but how
else can I do this?

Dim i As Integer
For i = 4 To 15
emptyCell2.Offset(0, i) = TextBoxi.Value
Next i



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Filling Cells from Textboxes

Thank you both for your response.

"Harald Staff" wrote:

Hi

There is no textbox collection like that anymore. You are better off with
long boring code like

emptyCell2.Offset(0, 4).Value = TextBox4.Text
emptyCell2.Offset(0, 5).Value = TextBox5.Text
emptyCell2.Offset(0, 6).Value = TextBox6.Text
emptyCell2.Offset(0, 7).Value = TextBox7.Text
emptyCell2.Offset(0, 8).Value = TextBox8.Text
' and so on

no fun to write, but runs fast and no-nonsense, and once it's written it's
done. Any loop technique will be either slower, more awkward to execute or
more memory consuming. A high price for a little less coding.

HTH. Best wishes Harald

"trini" skrev i melding
...
Hi everyone,
I am trying to fill about 12 cells from 12 textboxes and for some reason

my
code does not work. I know it has to do with the 'Textboxi.Value' but how
else can I do this?

Dim i As Integer
For i = 4 To 15
emptyCell2.Offset(0, i) = TextBoxi.Value
Next i




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Filling Cells from Textboxes

- Try This
Dim i As Integer
Cells(2,4).Select ' Root Cell
For i = 4 To 15
Cells(ActiveCell.Row, i) = UserForm.Controls("TextBox" & i).Value
Next i
"trini" wrote:

Hi everyone,
I am trying to fill about 12 cells from 12 textboxes and for some reason my
code does not work. I know it has to do with the 'Textboxi.Value' but how
else can I do this?

Dim i As Integer
For i = 4 To 15
emptyCell2.Offset(0, i) = TextBoxi.Value
Next i

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
Filling in blank cells with information from cells above it tracytracy123 Excel Discussion (Misc queries) 1 June 22nd 09 11:04 PM
filling cells Art Excel Discussion (Misc queries) 0 November 30th 06 03:36 PM
list alternatives to textboxes or merged cells in shared file UpTooLate37 Excel Discussion (Misc queries) 0 October 25th 06 05:12 AM
searching for a combobox.value and filling in textboxes from results GregJG[_18_] Excel Programming 3 July 8th 04 12:41 PM
Linking textboxes to cells with formulae David Coleman[_2_] Excel Programming 7 December 29th 03 02:22 PM


All times are GMT +1. The time now is 08:55 AM.

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

About Us

"It's about Microsoft Excel"