当前位置: 动力学知识库 > 问答 > 编程问答 >

excel - Losing mouse function after running show/hide worksheet macro

问题描述:

Excel is not resounding to mouse clicks after running the macro below. It responds to arrow keys and I can use the mouse to select menu items (File, edit, etc) but can't select any cells. If I close down excel and restart it's fine, but once I run the macro - same problem???

Sub ShowMonthlyCalcReports()

Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets

ws.Visible = xlSheetHidden

If Left(ws.Name, 2) = "MC" Then

ws.Visible = xlSheetVisible

ElseIf Left(ws.Name, 2) = "Ho" Then

ws.Visible = xlSheetVisible

Else: ws.Visible = xlSheetHidden

End If

Next ws

End Sub

分享给朋友:
您可能感兴趣的文章:
随机阅读: