Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1892|回复: 4

[已解决]第一次接触listview 关于listview

[复制链接]
发表于 2016-6-6 11:22 | 显示全部楼层 |阅读模式

Private Sub UserForm_Initialize()
CommandButton1.Caption = "返回"
CommandButton2.Caption = "退出"
With ListView1
.ColumnHeaders.Add , , "序号", 64, 0
.ColumnHeaders.Add , , "名称", 64, 0
End With
End Sub


输入了这个代码 但是却不能在试运行时显示列表如图,请老师指点
最佳答案
2016-6-6 14:53
Private Sub UserForm_Initialize()
    CommandButton1.Caption = "返回"
    CommandButton2.Caption = "退出"
    With ListView1
        .ColumnHeaders.Add , , "序号", 64, 0
        .ColumnHeaders.Add , , "名称", 64, 0
        .View = lvwReport
    End With
End Sub
123.png
发表于 2016-6-6 14:53 | 显示全部楼层    本楼为最佳答案   
Private Sub UserForm_Initialize()
    CommandButton1.Caption = "返回"
    CommandButton2.Caption = "退出"
    With ListView1
        .ColumnHeaders.Add , , "序号", 64, 0
        .ColumnHeaders.Add , , "名称", 64, 0
        .View = lvwReport
    End With
End Sub
回复

使用道具 举报

 楼主| 发表于 2016-6-6 17:24 | 显示全部楼层
zjdh 发表于 2016-6-6 14:53
Private Sub UserForm_Initialize()
    CommandButton1.Caption = "返回"
    CommandButton2.Caption = ...

再请教下 我设置了一个按钮,语句见附图,出现“类型不匹配”怎么回事??
QQ截图20160606171414.png
回复

使用道具 举报

发表于 2016-6-6 17:36 | 显示全部楼层
说明你scan2窗体的宏里存在“类型不匹配”!
回复

使用道具 举报

 楼主| 发表于 2016-6-6 17:44 | 显示全部楼层
zjdh 发表于 2016-6-6 17:36
说明你scan2窗体的宏里存在“类型不匹配”!

已经查明原因了,已解决 谢谢!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-25 10:19 , Processed in 0.317125 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表