使用vba操作列表框(表单控件,而不是activex控件) [英] Manipulate listbox (form control, not activex control) with vba

查看:818
本文介绍了使用vba操作列表框(表单控件,而不是activex控件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个列表框的报告,因此用户可以看到相关信息。该报告由vba在另一个工作簿中准备,该程序还在列表框中设置初始选择。例如,当我上次将报告发送给用户
时,我选择了"OCTOBER"。在其中一个列表框中(可用数据的最后一个月)。


我的问题是我无法看到如何使用vba滚动这样的列表框。例如,在月份列表框中,为了节省空间,所有月份都不会立即显示。但是如果选择了OCTOBER,当用户收到报告工作簿时,他没有
看看选择了哪个月(当选择JAN或FEB时没有问题,因为它们首先出现在列表框中)。 / p>

列表框是表单控件,因为这些列表框的输入范围和单元格链接属性非常易于使用。


有什么方法可以滚动这样的列表框使用vba?

解决方案


我想说..简单方法是在格式控件中,您可以为ListBox之外的单元格分配单元格链接。因此,用户始终可以在该单元格中查看选择的月份。


I have a report with several listboxes so the user can see the relevant information. The report is prepared by vba in another workbook, and the program also sets the initial selections in the list boxes. For instance, when I last sent the report to the users I selected "OCTOBER" in one of the listboxes (the last month of data available).

My problem is that I can not see how to scroll such a listbox with vba. In the listbox of months, for instance, to save space all the months are not visible at once. But then if OCTOBER is selected, when the user receives the report workbook, he does not see what month is selected (when JAN or FEB is selected there is no problem, because they appear first in the list box).

The listboxes are form controls because the input range and cell link properties of such listboxes are very easy to work with.

Is there any way to scroll such a listbox using vba?

解决方案

Hi,

I would say.. A simple way would be to in the format control you can assign a Cell Link to a cell besides the ListBox. So user can always see in that cell like what month is selected.


这篇关于使用vba操作列表框(表单控件,而不是activex控件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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