ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¬¡­¶Ã¯¯à¥Î°}¦C¦P®ÉÁôÂéΥX²{¶Ü¡H

[µo°Ý] ¬¡­¶Ã¯¯à¥Î°}¦C¦P®ÉÁôÂéΥX²{¶Ü¡H

Sheets(¡§aa¡¨).Visible=False
Sheets(¡§av¡¨).Visible=False
Sheets(¡§ca¡¨).Visible=False

¦]¬°·Q­n¦P®ÉÁôÂáA¦]¬°¬¡­¶Ã¯¦³«Ü¦h­Ó
³o¼Ë·|¾É­Pµ{¦¡½X¤Óªø¡A¤£ª¾¬O§_¯à¥Î°}¦C¤è¦¡§e²{ÁôÂäΥX²{ªº¥\¯à

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-5-1 15:51 ½s¿è

¦^´_ 1# feecshyrnd
  1. Option Explicit

  2. Sub Ex()
  3.     Dim arr As Variant, cts As Integer, j As Integer
  4.    
  5.     arr = Array("¤u§@ªí2", "¤u§@ªí3")
  6.    
  7.     For cts = 1 To Sheets.Count
  8.         For j = 0 To UBound(arr)
  9.             If Sheets(cts).Name = arr(j) Then Sheets(cts).Visible = _
  10.                 Not Sheets(cts).Visible
  11.         Next j
  12.     Next cts
  13. End Sub
½Æ»s¥N½X

TOP

§Ú¤]¨Ó½m²ß¸É¥R¤@­Ó
  1. Sub ex1()
  2.     Dim Arr As Variant, xS
  3.     Arr = Array("Sheet2", "Sheet3", "Sheet4")
  4.     On Error Resume Next
  5.     For Each xS In Arr
  6.         Sheets(xS).Visible = Not Sheets(xS).Visible
  7.     Next
  8. End Sub
½Æ»s¥N½X
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 3# ML089
¤£¿ù¡Aª½±µ¤FÂ_°®²b«W¸¨¡C¨ü±Ð¤F¡I

TOP

¦^´_ 3# ML089


³o­n¤Tªí¦P®Éª¬ºA¤~¦æ,
­Y¬O 1,0,1 °õ¦æ«á 0,1,0 ÁÙ¬O¦³¤@±i¥¼ÁôÂÃ!
¤£µM´N¥H²Ä¤@±iªí¬°¨Ì¾Ú¨Ó§PÂ_!!!

TOP

¦^´_ 5# ­ã´£³¡ªL
§Aªº·N«ä¬O¡G
  1. Sub Ex2()
  2.     Dim arr As Variant, xS As Variant
  3.     Static tf As Boolean
  4.    
  5.     tf = Not tf
  6.     arr = Array("¤u§@ªí2", "¤u§@ªí3", "¤u§@ªí4")
  7.     On Error Resume Next
  8.     For Each xS In arr
  9.         '  Sheets(xS).Visible = Not Sheets(xS).Visible
  10.         Sheets(xS).Visible = tf
  11.     Next
  12. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# ­ã´£³¡ªL

­ã¤j¦Ò¼{©P¸Ô¡A½Ðµ¹§Ú­Ì¤@­Ó¥Ü½d¨Ò¡C
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 6# c_c_lai


ARR = Array("¤u§@ªí2", "¤u§@ªí3", "¤u§@ªí4")
TF = 1 + Sheets(ARR(0)).Visible
For Each xS In ARR
¡@¡@Sheets(xS).Visible = TF
Next

TOP

¦^´_ 6# c_c_lai

¯u¼F®`!
¤S¾Ç¨ì  Static tf As Boolean
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 8# ­ã´£³¡ªL

3Q

¤U¨â¦¡ªº­pºâ­È¦³¨Ç¤£¦P¡A³£¥i¥H¹F¨ì ÁôÂÃ/Åã¥Ü ªº¤Á´«
    tf = Not Sheets(arr(0)).Visible '­ÈÅÜ¤Æ : 0 / -1
    tf = 1 + Sheets(arr(0)).Visible  '­ÈÅÜ¤Æ : 0 / 1
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

        ÀR«ä¦Û¦b : µêªÅ¦³ºÉ¡D§ÚÄ@µL½a¡AµoÄ@®e©ö¦æÄ@Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD