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

¦³Ãö´¡¤J¹Ï¤ùªº°ÝÃD

¦³Ãö´¡¤J¹Ï¤ùªº°ÝÃD

¦U¦ì¥ý¶i¤j®a¦n¡I
        ¤£¦n·N«ä¡I¤p§Ì¤S¨Ó¥´ÂZ¤F¡C¤p§Ìªº°ÝÃD¬O¡G§Ú¦b¬¡­¶Ã¯¸Ì´¡¤J«Ü¦h±i¦P¼Ëªº¹Ï¤ù¡]¾Ç®Õªº®ÕÀ²¡^¡A¨C¹j´X¦æ´N·|¥X²{¤@±i¡A¦ý¬O¦b»yªk¸Ì¦³ÁôÂææ¦Cªº»yªk¡G
    .Cells.Rows.Hidden = False
    .Range("a" & 1 + 26 * k, .Range("a1041")).EntireRow.Hidden = True
    .Range("a1041", Range("a1041").End(xlDown)).EntireRow.Hidden = True
°ÝÃD¦b©ó¡A¦³¹Ï¤ùªº¦æ¦C³QÁôÂáA¤@¥¹¤S³Q¨ú®øÁôÂ䧫á¡A´N·|µo²{¹Ï¤ù³QÀ£ÁY¤F¡C¤£ª¾³o­Ó°ÝÃD¦p¦ó¸Ñ¨M©O¡H

·PÁª©¤j¡I§Ú¤S¥hºô¸ô¤W§ä¤F¤@¤U¦³ÃöEnableEventsªº¸ê®Æ¡AÅý§Ú¦h¤W¤F¤@½Ò¡A¤]¶êº¡ªº¸Ñ¨M³o­Ó°ÝÃD¤F¡C

TOP

¦^´_ 32# skyutm
EnableEvents ÄÝ©Ê ¦pªG«ü©wª«¥ó¯àIJµo¨Æ¥ó¡A«h¥»Äݩʬ° True¡CŪ/¼g Boolean¡C
  1. Sub macor24()
  2.     '¸Ñ°£«OÅ@¡u¦¨ÁZÀx¦s¡vªí®æ¡õ'
  3.    Application.EnableEvents = False  '°±¤îª«¥ó¯àIJµo¨Æ¥ó
  4.     Sheets("¦¨ÁZÀx¦s").Unprotect Password:="6323"
  5.     '¸Ñ°£«OÅ@¡u¦¨ÁZÀx¦s¡vªí®æ¡ô
  6.     Dim a, b, u, v, r, n As String
  7.     a = Sheets("°ò¥»³]©w").Range("a6").Value
  8.     b = Sheets("°ò¥»³]©w").Range("a8").Value
  9.     u = Sheets("°ò¥»³]©w").Range("j1").Value
  10.     v = Sheets("°ò¥»³]©w").Range("j2").Value
  11.    r = "C:\Documents and Settings\Administrator\®à­±\"
  12.     n = a & "¾Ç¦~«×" & b & "¾Ç´Á" & u & "¦~" & v & "¯Z¦¨ÁZÀÉ"
  13.    
  14.     Sheets("¦¨ÁZÀx¦s").Copy
  15.     With ActiveWorkbook
  16.          Application.DisplayAlerts = False
  17.          .SaveAs Filename:=r & n & ".xls", FileFormat:=51
  18.          Application.DisplayAlerts = False
  19.          '«OÅ@¡u¦¨ÁZÀx¦s¡vªí®æ¡õ'
  20.          Sheets("¦¨ÁZÀx¦s").Activate
  21.          ActiveSheet.EnableSelection = xlUnlockedCells
  22.          Sheets("¦¨ÁZÀx¦s").Protect Password:="6323"
  23.          '«OÅ@¡u¦¨ÁZÀx¦s¡vªí®æ¡ô'
  24.          .Close savechanges:=True
  25.     End With
  26.     Application.EnableEvents = True '«ì´_ª«¥ó¯àIJµo¨Æ¥ó
  27. End Sub
½Æ»s¥N½X
  1. Option Explicit
  2. Sub Worksheet_Activate()
  3. ' ***  On Error Resume Next  ¥i§R±¼
  4.     Application.ScreenUpdating = False
½Æ»s¥N½X

TOP

¦^´_ 31# GBKEE
ª©¤j±z¦n¡I¦A¦¸·PÁ¡Cªþ¤WÀɮסC¤u§@ªí¬O¡u¦¨ÁZÀx¦s¡v¥¦¬O¡u¾ÇÄyï¡v¤u§@ªíªº½Æ»s¡C¥¨¶°¬Omacro24

·s¸ô¦¨ÁZ¨t²Î.rar (379.76 KB)

TOP

¦^´_ 30# skyutm
¥[¤@¦æOn Error Resume Next¡A³o¼Ë´N¥i¥H¸Ñ¨M¤F¡C¡]¤£ª¾³o¼Ë¦³µL­·ÀI¶Ü¡H¡^
¬O¦³ªº ¦p¦³¿ù»~ªº»yªk©ÎÅܼƮѼg¿ù»~, VBA¬O¤£³B¸Ìªº.
½ÐªþÀɬݬÝ

TOP

¦^´_ 29# GBKEE
¦^´_ª©¤j¡A°ÝÃDÁÙ¬O¦s¦b­C¡A¦]¬°­è­è¹êÅç®É¬O¦b·sªºÀɮ׸̥[´X¦æ»yªk¡Aµ²ªGÀÉ®×Ãö³¬«á¦A­«¶}»yªk´N¤£¨£¤F¡Cµ¥¨ì§Ú¹B¥Î¦b¦Û¤vªº¦¨ÁZ¨t²Î¤§«á¡A°ÝÃD´N¥X²{¤F¡C¦]¬°³Q½Æ»sªº¤u§@ªí»yªk¬O¼g¦bWorksheet_Activate¸Ì¡A©Ò¥H¥u­n½Æ»sÀɮ׮ɡAÁÙ¥¼Ãö³¬¡A»yªk¿ù»~¦æ´N·|¥X²{¡]ÁÙ¨Ó¤£¤ÎÃö³¬¡^¡C
«á¨Ó§Ú¤S·Q¥X¤@­Ó¿ìªk¡A´N¬O¦b³Q½Æ»sªº¤u§@ªí»yªk¸Ì­±¡A¥[¤@¦æOn Error Resume Next¡A³o¼Ë´N¥i¥H¸Ñ¨M¤F¡C¡]¤£ª¾³o¼Ë¦³µL­·ÀI¶Ü¡H¡^

TOP

¦^´_ 28# skyutm
°õ¦æ2 4# ªºµ{¦¡½X«á ¶·±NÀÉ®×Ãö³¬,µM«á¦A¥´¶}¤~·|µL¥¨¶°
  1. Workbooks(1).Sheets(1).Copy        '->½Æ»sSheets(1) ªº¤u§@ªí·|¦b·s¼Wªº¬¡­¶Ã¯      
  2. With ActiveWorkbook                     '>·s¼Wªº¬¡­¶Ã¯
  3.         Application.DisplayAlerts = False
  4.         .SaveAs "d:\µL¥¨¶°.xlsx", FileFormat:=51 ' xlExcel8
  5.       '**  °ÆÀɦW:xlsx  ¬°µLVBA¥¨¶° ªº¬¡­¶Ã¯
  6.       '***'¦sÀÉ«á ÁÙ¬O¦³¥¨¶°
  7.         Application.DisplayAlerts = False
  8.      .Close            '26#·s¥[ªºµ{¦¡½X  *** Ãö³¬ÀÉ®×
  9.     End With
  10.     Workbooks.Open ("d:\µL¥¨¶°.xlsx")   '26#·s¥[ªºµ{¦¡½X  *** ¶}±ÒÀÉ®×
½Æ»s¥N½X

TOP

¦^´_ 27# skyutm
ª©¤j±z³o»ò¤@»{¯u°_¨Ó¡A§Ú­Ë¬O¦³¨Ç³Q·d°g½k¤F¡C§Ú¤ñ¸û¤F«e«á¨â­Ó»yªk¥u®t¦b
Option Explicit
.Close
Workbooks.Open ("d:\µL¥¨¶°.xlsx")
³o¤T¦æ¦Ó¤w¡A¦Ó§Ú¤£À´¡A¬°¦ó³o¼Ë»yªkªº®t²§·|³y¦¨¤£¦Pªºµ²ªG¡H

TOP

¦^´_ 26# GBKEE
ª©¤j¹ê¦b¬O¤Ó¼ö¤ß¤F¡AÁæ¦Ó¤£±Ë²×©ó´ú¸Õ¦¨¥\¤F¡A³Ì«á³o­Ó¥i¥H¡AÀɮפº¤wµL¥¨¶°¡I

TOP

¦^´_ 25# skyutm
½Ð°Ý§A°õ¦æµ{¦¡«á¦³±N¦¹ÀÉ®×Ãö³¬,µM«á¦b¥´¶}¬Ý¬Ý,¦¹Àɮר̵M¬O¦³¥¨¶°¦s¦b¶Ü?
¦A¸Õ¸Õ¬Ý
  1. Sub Ex() '½m²ß¸Õ¸Õ¬Ý   ¬¡­¶Ã¯,¤u§@ªí: ¶·¬Ò¨S¤WÂꪺª¬ºA
  2.     Workbooks(1).Sheets(1).Copy            ' Sheets(1) ½Ð¥ý»s§@VBA¥¨¶°
  3.     'Workbooks("TEST").Sheets("TEST").Copy   ' Sheets(1) ½Ð¥ý»s§@VBA¥¨¶°
  4.     With ActiveWorkbook
  5.         Application.DisplayAlerts = False
  6.         .SaveAs "d:\µL¥¨¶°.xlsx", FileFormat:=51 ' xlExcel8
  7.          '**  °ÆÀɦW:xlsx  ¬°µLVBA¥¨¶° ªº¬¡­¶Ã¯
  8.         Application.DisplayAlerts = False
  9.         .Close
  10.     End With
  11.     Workbooks.Open ("d:\µL¥¨¶°.xlsx")
  12. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦n¨Æ­n´£±o°_¡A¬O«D­n©ñ±o¤U¡A¦¨´N§O¤H§Y¬O¦¨´N¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD