1、首先在开发工具中打开VBA编辑器
2、在单元格区域当中输入一些内容作为例子
3、在VBA编辑器中插入模块
4、在模块当中输入如下代码,然后运行Private Sub CommandButton补朱锚卦3_Click()Me.WebBrowser1.Navigate "about:blank"Me.WebBrowser1.Document.writeln "<html><head></head><body style='border:none;overflow:hidden;margin:0' oncontextmenu='return false'><p>" _& "<marquee scrollamount='1' direction='UP' width='170' id='help'height='200' onmouseover='help.stop()' onmouseout='help.start()'>" & _" 本例的作用即利用列表框的Selected(i)属性和AddItem方法将列表框1的选中项目添加到列表框2.</marquee></p></body></html>"End Sub
5、用快捷键F5运行窗体,然后单击“显示说明”按钮,窗体的网页文字开始从下向上滚动,若腱懒幺冁鼠标移过文字则文字停止滚动,鼠标移开则继续滚动,如图