返回列表 上一主題 發帖

[發問] 如何關閉程式碼視窗

  1. Sub CloseAllVBEWindows()
  2. ' Written by HansV , https://eileenslounge.com/viewtopic.php?t=19961
  3.     Dim i As Long
  4.     With Application.VBE.Windows
  5.         For i = .Count To 1 Step -1
  6.             With .Item(i)
  7.                 If .Type <= 1 Then ' 0 = vbext_wt_CodeWindow, 1 = vbext_wt_Designer
  8.                     .Close
  9.                 End If
  10.             End With
  11.         Next i
  12.     End With
  13. End Sub
複製代碼

TOP

        靜思自在 : 看別人不順眼,是自己修養不夠。
返回列表 上一主題