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

VBA¬O§_¦³°»´ú§R°£SHEETªº¨Æ¥ó¡H

VBA¬O§_¦³°»´ú§R°£SHEETªº¨Æ¥ó¡H

¥»©«³Ì«á¥Ñ mtc0611 ©ó 2012-6-7 18:56 ½s¿è

sorry¡I¤w­«·s¤W¶ÇÀÉ®×

¦]¬°¨Ï¥Îªº¤À­¶²³¦h¡A©Ò¥H¥t¥~§@¤@­Ó¯Á¤Þ­¶¤º¦³¦U­¶ªº¶W³sµ²
ÁÙ¼g¤F¤@­Ó¥¨¶°mainRefresh¡A·|¦Û°Ê²£¥Í¦USHEETªº¶W³sµ²

­ì¥»¬O§â¥¨¶°¥á¦bSheetActivate
¥u­n¤Á´«¨ì­º­¶´N¦Û°Ê¨ê·s¤@¦¸³sµ²
¦ý¤À­¶Åܦh®É¥u­n¤Á¨ì­º­¶´N·|ÅܺC

©Ò¥H§ï¦¨·íSHEET·s¼W©Î§R°£®É¤~·|°õ¦æmainRefresh
¦ý·s¼W¤À­¶¥i¥H¥ÎNewsheet¨Æ¥ó¹ê²{
¥i¬O§R°£sheetªº¨Æ¥ó´N§ä¤£¨ì¤F
¦³¨ä¥L¿ìªk¥i¥H§@¨ì¶Ü¡H

1.rar (290.75 KB)

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-6-7 17:10 ½s¿è

¦^´_ 1# mtc0611
ÀÉ®× ¥[±K ¦p¦ó¥æ¬y??
­ì¥»¬O§â¥¨¶°¥á¦bSheetActivate         ¥[¤W     xlShCount = Sheets.Count ¨Ó§PÂ_¬O§_¦³§R°£ ¤u§@ªí
  1. Option Explicit
  2. Dim xlShCount As Integer
  3. Private Sub Workbook_Open()
  4.     ¾ã²z
  5. End Sub
  6. Private Sub Workbook_NewSheet(ByVal Sh As Object)
  7.     Application.EnableEvents = False
  8.     If Sheets("­¶­º").Index <> 1 Then
  9.         Sheets("­¶­º").Move Sheets(1)
  10.         Sh.Activate
  11.     End If
  12.     ¾ã²z
  13.     Application.EnableEvents = True
  14. End Sub
  15. Private Sub Workbook_SheetActivate(ByVal Sh As Object)
  16.     If xlShCount <> Sheets.Count Then ¾ã²z
  17. End Sub
  18. Private Sub ¾ã²z()
  19.     Dim xi As Integer
  20.     With Sheets(1)
  21.         .Columns(1) = ""
  22.         For xi = 2 To Sheets.Count
  23.            .Hyperlinks.Add Anchor:=.Cells(xi, "a"), Address:="", SubAddress:=Sheets(xi).[A1].Address(, , , 1), TextToDisplay:=Sheets(xi).Name
  24.         Next
  25.     End With
  26.     xlShCount = Sheets.Count
  27. End Sub
½Æ»s¥N½X

TOP

¦hÁ«ü±Ð¡I
­ì¨Ó¦Û¤w¼gªºcode¦³¨Ç¦a¤è¬O¦h¾lªº

TOP

        ÀR«ä¦Û¦b : ¤H­nª¾ºÖ¡B±¤ºÖ¡B¦A³yºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD