ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem in adding item to a checkbox (https://www.excelbanter.com/excel-programming/295283-problem-adding-item-checkbox.html)

Shilps

Problem in adding item to a checkbox
 
I have a code

Dim i As Intege
r = Range("AR5000").End(xlUp).Ro
For i = 2 To
ComboBox3.AddItem CStr(Sheet1.Range("AR" + CStr(i)).Value
Nex

whenever I run, it gives runtime error 70: Permission denied
I want to add the entries in column AR to the dropdown list of the combobox. I cannot use listfillrange as the data will be lost when entries in AR change . AR stores the data resulting from a query
TI
Shilps

Bob Flanagan

Problem in adding item to a checkbox
 
I looks like you have not qualified the combobox. For example:

Userform1.ComboBox3.AddItem CStr(Sheet1.Range("AR" + CStr(i)).Value)

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Shilps" wrote in message
...
I have a code:

Dim i As Integer
r = Range("AR5000").End(xlUp).Row
For i = 2 To r
ComboBox3.AddItem CStr(Sheet1.Range("AR" + CStr(i)).Value)
Next

whenever I run, it gives runtime error 70: Permission denied.
I want to add the entries in column AR to the dropdown list of the

combobox. I cannot use listfillrange as the data will be lost when entries
in AR change . AR stores the data resulting from a query.
TIH
Shilps




Tim Zych[_7_]

Problem in adding item to a checkbox
 
Is ListFillRange being used? If so, ListFillRange and AddItem can't be used
simultaneously.


"Shilps" wrote in message
...
I have a code:

Dim i As Integer
r = Range("AR5000").End(xlUp).Row
For i = 2 To r
ComboBox3.AddItem CStr(Sheet1.Range("AR" + CStr(i)).Value)
Next

whenever I run, it gives runtime error 70: Permission denied.
I want to add the entries in column AR to the dropdown list of the

combobox. I cannot use listfillrange as the data will be lost when entries
in AR change . AR stores the data resulting from a query.
TIH
Shilps




Shilps

Problem in adding item to a checkbox
 
I am sorry Bob, but qualiifying the ComboBox didn't help:
I modified the code to
Dim i As Intege
r = Range("AR5000").End(xlUp).Ro
For i = 2 To
Worksheets("QUERY_BUILDER").ComboBox3.AddItem CStr(Sheet1.Range("AR" + CStr(i)).Value
Nex

But I am getting the same error.


All times are GMT +1. The time now is 11:28 AM.

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