Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default Add Item To ComboBox List

Greetings,

I have a ComboBox that is loaded when the UserForm is Initialized.
But sometimes I need to add a name to the bottom of the ComboBox list
from a TextBox. I am getting this error message:

Runtime error '70':
Could not set the List property. Permission denied.

Here is the code:

ComboBox1.List(ComboBox1.ListIndex, 2) = TextBox1.Value

I need the value of TextBox1 inserted into the 3rd column of the
ComboBox1 row that is currently chosen.

Is this possible? If so, how do I do it?

Any help would be appreciated.

-Minitman
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default Add Item To ComboBox List

Update:

I changed the style property back to "0 - fmStyleDropDownCombo". The
code went a little further before it was stopped by this error
message:

Run-time error '381':
Could not get the List property. Invalid property array index.

With this code:

ComboBox1.List(ComboBox1.ListIndex, 2)

I forgot to mention earlier, the named range that is the 'RowSource'
for ComboBox1 is 27 rows high and 105 columns wide. It is the 3rd
column that is displayed in ComboBox1. It is this same third column
(in the 1st empty row) that I am trying to add to from TextBox1.

Anyone have any ideas as to how to eliminate this error?

Any help would be appreciated

-Minitman

On Tue, 02 Sep 2008 07:55:26 -0500, Minitman
wrote:

Greetings,

I have a ComboBox that is loaded when the UserForm is Initialized.
But sometimes I need to add a name to the bottom of the ComboBox list
from a TextBox. I am getting this error message:

Runtime error '70':
Could not set the List property. Permission denied.

Here is the code:

ComboBox1.List(ComboBox1.ListIndex, 2) = TextBox1.Value

I need the value of TextBox1 inserted into the 3rd column of the
ComboBox1 row that is currently chosen.

Is this possible? If so, how do I do it?

Any help would be appreciated.

-Minitman


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Add Item To ComboBox List

If you're using .rowsource, then you won't be able to mess with the list.

You could use .additem, but then you're limited to 10 columns in your combobox.

Do you need all 105 columns showing up in your combobox?

If you do, then you may want to just plop the values of the textbox into the
rowsource range???

Minitman wrote:

Update:

I changed the style property back to "0 - fmStyleDropDownCombo". The
code went a little further before it was stopped by this error
message:

Run-time error '381':
Could not get the List property. Invalid property array index.

With this code:

ComboBox1.List(ComboBox1.ListIndex, 2)

I forgot to mention earlier, the named range that is the 'RowSource'
for ComboBox1 is 27 rows high and 105 columns wide. It is the 3rd
column that is displayed in ComboBox1. It is this same third column
(in the 1st empty row) that I am trying to add to from TextBox1.

Anyone have any ideas as to how to eliminate this error?

Any help would be appreciated

-Minitman

On Tue, 02 Sep 2008 07:55:26 -0500, Minitman
wrote:

Greetings,

I have a ComboBox that is loaded when the UserForm is Initialized.
But sometimes I need to add a name to the bottom of the ComboBox list
from a TextBox. I am getting this error message:

Runtime error '70':
Could not set the List property. Permission denied.

Here is the code:

ComboBox1.List(ComboBox1.ListIndex, 2) = TextBox1.Value

I need the value of TextBox1 inserted into the 3rd column of the
ComboBox1 row that is currently chosen.

Is this possible? If so, how do I do it?

Any help would be appreciated.

-Minitman


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default Add Item To ComboBox List

Hey Dave,

Thanks for the reply.

Here is the code I use to load ComboBox1 at the UserForm
Initialization:

Set rListInput = ws1_2.Range("rInput" & iTD)
With ComboBox1
.RowSource = "'Input'!" & rListInput.Address
.ColumnCount = rListInput.Columns.Count
.ListIndex = 0
End With

rInput is a series of named ranges. iTD has a range of 1 to 31.
These ranges are 27 rows high and 105 columns wide.

I chose this method for ease of loading and modifying 105 TextBoxes on
a UserForm (code available upon request).

Do you know of a better way to load ComboBox1 and make it dynamic to
change as needed?

-Minitman



On Tue, 02 Sep 2008 10:10:53 -0500, Dave Peterson
wrote:

If you're using .rowsource, then you won't be able to mess with the list.

You could use .additem, but then you're limited to 10 columns in your combobox.

Do you need all 105 columns showing up in your combobox?

If you do, then you may want to just plop the values of the textbox into the
rowsource range???

Minitman wrote:

Update:

I changed the style property back to "0 - fmStyleDropDownCombo". The
code went a little further before it was stopped by this error
message:

Run-time error '381':
Could not get the List property. Invalid property array index.

With this code:

ComboBox1.List(ComboBox1.ListIndex, 2)

I forgot to mention earlier, the named range that is the 'RowSource'
for ComboBox1 is 27 rows high and 105 columns wide. It is the 3rd
column that is displayed in ComboBox1. It is this same third column
(in the 1st empty row) that I am trying to add to from TextBox1.

Anyone have any ideas as to how to eliminate this error?

Any help would be appreciated

-Minitman

On Tue, 02 Sep 2008 07:55:26 -0500, Minitman
wrote:

Greetings,

I have a ComboBox that is loaded when the UserForm is Initialized.
But sometimes I need to add a name to the bottom of the ComboBox list
from a TextBox. I am getting this error message:

Runtime error '70':
Could not set the List property. Permission denied.

Here is the code:

ComboBox1.List(ComboBox1.ListIndex, 2) = TextBox1.Value

I need the value of TextBox1 inserted into the 3rd column of the
ComboBox1 row that is currently chosen.

Is this possible? If so, how do I do it?

Any help would be appreciated.

-Minitman


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Add Item To ComboBox List

Not if you need all 105 columns.

Minitman wrote:

Hey Dave,

Thanks for the reply.

Here is the code I use to load ComboBox1 at the UserForm
Initialization:

Set rListInput = ws1_2.Range("rInput" & iTD)
With ComboBox1
.RowSource = "'Input'!" & rListInput.Address
.ColumnCount = rListInput.Columns.Count
.ListIndex = 0
End With

rInput is a series of named ranges. iTD has a range of 1 to 31.
These ranges are 27 rows high and 105 columns wide.

I chose this method for ease of loading and modifying 105 TextBoxes on
a UserForm (code available upon request).

Do you know of a better way to load ComboBox1 and make it dynamic to
change as needed?

-Minitman

On Tue, 02 Sep 2008 10:10:53 -0500, Dave Peterson
wrote:

If you're using .rowsource, then you won't be able to mess with the list.

You could use .additem, but then you're limited to 10 columns in your combobox.

Do you need all 105 columns showing up in your combobox?

If you do, then you may want to just plop the values of the textbox into the
rowsource range???

Minitman wrote:

Update:

I changed the style property back to "0 - fmStyleDropDownCombo". The
code went a little further before it was stopped by this error
message:

Run-time error '381':
Could not get the List property. Invalid property array index.

With this code:

ComboBox1.List(ComboBox1.ListIndex, 2)

I forgot to mention earlier, the named range that is the 'RowSource'
for ComboBox1 is 27 rows high and 105 columns wide. It is the 3rd
column that is displayed in ComboBox1. It is this same third column
(in the 1st empty row) that I am trying to add to from TextBox1.

Anyone have any ideas as to how to eliminate this error?

Any help would be appreciated

-Minitman

On Tue, 02 Sep 2008 07:55:26 -0500, Minitman
wrote:

Greetings,

I have a ComboBox that is loaded when the UserForm is Initialized.
But sometimes I need to add a name to the bottom of the ComboBox list
from a TextBox. I am getting this error message:

Runtime error '70':
Could not set the List property. Permission denied.

Here is the code:

ComboBox1.List(ComboBox1.ListIndex, 2) = TextBox1.Value

I need the value of TextBox1 inserted into the 3rd column of the
ComboBox1 row that is currently chosen.

Is this possible? If so, how do I do it?

Any help would be appreciated.

-Minitman


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default Add Item To ComboBox List

Hey Dave,

I was afraid of that.

Thanks for the input.

-Minitman


On Tue, 02 Sep 2008 13:07:56 -0500, Dave Peterson
wrote:

Not if you need all 105 columns.

Minitman wrote:

Hey Dave,

Thanks for the reply.

Here is the code I use to load ComboBox1 at the UserForm
Initialization:

Set rListInput = ws1_2.Range("rInput" & iTD)
With ComboBox1
.RowSource = "'Input'!" & rListInput.Address
.ColumnCount = rListInput.Columns.Count
.ListIndex = 0
End With

rInput is a series of named ranges. iTD has a range of 1 to 31.
These ranges are 27 rows high and 105 columns wide.

I chose this method for ease of loading and modifying 105 TextBoxes on
a UserForm (code available upon request).

Do you know of a better way to load ComboBox1 and make it dynamic to
change as needed?

-Minitman

On Tue, 02 Sep 2008 10:10:53 -0500, Dave Peterson
wrote:

If you're using .rowsource, then you won't be able to mess with the list.

You could use .additem, but then you're limited to 10 columns in your combobox.

Do you need all 105 columns showing up in your combobox?

If you do, then you may want to just plop the values of the textbox into the
rowsource range???

Minitman wrote:

Update:

I changed the style property back to "0 - fmStyleDropDownCombo". The
code went a little further before it was stopped by this error
message:

Run-time error '381':
Could not get the List property. Invalid property array index.

With this code:

ComboBox1.List(ComboBox1.ListIndex, 2)

I forgot to mention earlier, the named range that is the 'RowSource'
for ComboBox1 is 27 rows high and 105 columns wide. It is the 3rd
column that is displayed in ComboBox1. It is this same third column
(in the 1st empty row) that I am trying to add to from TextBox1.

Anyone have any ideas as to how to eliminate this error?

Any help would be appreciated

-Minitman

On Tue, 02 Sep 2008 07:55:26 -0500, Minitman
wrote:

Greetings,

I have a ComboBox that is loaded when the UserForm is Initialized.
But sometimes I need to add a name to the bottom of the ComboBox list
from a TextBox. I am getting this error message:

Runtime error '70':
Could not set the List property. Permission denied.

Here is the code:

ComboBox1.List(ComboBox1.ListIndex, 2) = TextBox1.Value

I need the value of TextBox1 inserted into the 3rd column of the
ComboBox1 row that is currently chosen.

Is this possible? If so, how do I do it?

Any help would be appreciated.

-Minitman


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Add Item To ComboBox List

Hi Minitman

if you are using Rowsource you will have to pass the data from your
textbox to your worksheet which will in turn update your combobox,
something like the code below will do what you want i think. it will
change the value in the third column of the selected row in the
combobox.

With Sheets("Sheet1")

.Cells(ComboBox1.ListIndex + 1, 3).Value = TextBox1.Value

End With

hope this helps

Steve

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default Add Item To ComboBox List

Hey Steve,

Thanks for the reply.

I tried your code. It works somewhat but It has two problems.

It won't continue (it freezes) and it only affects the 1st named range
regardless of what day the user is working with.

I was able adjust the position of the entry, accept for which day it
showed up in (it only shoes up in day 1)..

The name of the chosen named range is Range("rInput" & iTD)

Any ideas as to how to get this to work?

Again thanks for the help.

-Minitman



On Tue, 2 Sep 2008 08:24:11 -0700 (PDT), Incidental
wrote:

Hi Minitman

if you are using Rowsource you will have to pass the data from your
textbox to your worksheet which will in turn update your combobox,
something like the code below will do what you want i think. it will
change the value in the third column of the selected row in the
combobox.

With Sheets("Sheet1")

.Cells(ComboBox1.ListIndex + 1, 3).Value = TextBox1.Value

End With

hope this helps

Steve


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
ComboBox Will Not Advance To next Item in list Minitman Excel Programming 0 May 29th 08 07:30 AM
Combobox item selection+pop up list N.F[_2_] Excel Programming 3 June 13th 07 10:53 PM
Combobox - can't get click event to run for first item in the list Dale Excel Programming 3 August 9th 06 02:55 AM
combobox list item with superscript boyze Excel Programming 1 April 26th 06 06:07 PM
Automated Delete Item from ComboBox List ToferKing Excel Programming 10 April 23rd 06 07:46 PM


All times are GMT +1. The time now is 11:23 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"