Listbox ListFillRange [英] Listbox ListFillRange

查看:365
本文介绍了Listbox ListFillRange的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在表单上插入了表单控件列表框。由于某种原因,这会导致错误。

  Sheet1.Shapes(ListBox1)。ListFillRange =A1:A10

我想用范围填充列表框,但是我收到运行时错误'438',对象不支持此属性或方法。我在这里缺少什么?

解决方案

如果是表单列表框,请使用以下命令:图形(ListBox1)。ControlFormat.ListFillRange =A1:A10
$ b $ / code>

或与范围对象:

  With Worksheets(Sheet1)
.Shapes(ListBox1)。ControlFormat.List = .Range(A1:A10)。
结束


I have inserted a form control listbox on my sheet. For some reason this errors out.

Sheet1.Shapes("ListBox1").ListFillRange = "A1:A10"

I'd like to fill the listbox with the range but I get a Run-time error '438', Object doesn't support this property or method. What am I missing here?

解决方案

If it is Form listbox, use this one:

Worksheets("Sheet1").Shapes("ListBox1").ControlFormat.ListFillRange = "A1:A10"

or with Range object:

With Worksheets("Sheet1")
    .Shapes("ListBox1").ControlFormat.List = .Range("A1:A10").Value
End With

这篇关于Listbox ListFillRange的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆