作者:乔山办公网日期:
返回目录:excel表格制作
那么,你需要学习窗体,并在窗体中使用各类控件。
做个启动的代码zd,在版sheet里面用change触发
Private Sub Worksheet_Change(ByVal Target As Range)
if target.address=$A$1 then
if cells(1,1)=1 then
call 1
elseif cells(1,1)=2 then
call 1
……
endif
else
exit sub
endif
End Sub
大概是这样权
在工具栏上copy右击,单击自定义项目,在命令选项止中找到类别中的“宏百”,在右侧,把 自定义宏按钮拖拽到工具栏上度合适的位置,右击这个按钮,指定宏,改名称,改按钮上的图案,这都是可以的。
最后再知关闭对话框就可以了。,道纯手打,望采纳答案哦,谢谢
在SHEET1和SHEET2的A1单元格分别设置下拉菜单"A,B"
然后在两个工作e68a84e8a2ade79fa5e98193362表中分别加入如下代码:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim iRow, iCol As Integer
iRow = Target.Row
iCol = Target.Column
If iRow = 1 And iCol = 1 And Target <> "" Then
Application.EnableEvents = False
Application.ScreenUpdating = False
On Error Resume Next
If [A1] = "B" Then
Sheets("Sheet2").Visible = True
Sheets("Sheet1").Visible = False
Sheets("Sheet2").Select
Else
If [A1] = "A" Then
Sheets("Sheet1").Visible = True
Sheets("Sheet2").Visible = False
Sheets("Sheet1").Select
End If
End If
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
End Sub