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

­×§ï¬¡­¶Ã¯¦WºÙ

­×§ï¬¡­¶Ã¯¦WºÙ

Àɮפ¤¦³°w¹ï­×§ï¬¡­¶Ã¯¦WºÙ¥hºÞ²z¡A¦ý¬OµLªkºÞ²z¤u§@ªí­¶­±¤¤¡A¨Ï¤w¸g¦s¦b¤u§@ªí¦WºÙ¤£­n­×§ï¡A¬O§_¦³µ{¦¡¼¶¼g¤W±o¿ù»~¡C
  1. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
  2. 'Updateby MMC&LBC 107.09.11
  3. Dim i As Integer
  4. Dim Name, code, t As String
  5. Dim xR, fd, PW As Range
  6. Dim wSheet As Worksheet

  7.    code = ":/\?*[]"
  8.    Set xR = Cells(Rows.Count, "C").End(xlUp)(2)
  9.      
  10.      If xR.Row > 1 Then
  11.      While xR = ""
  12.      xR = ActiveSheet.Name                 '¦b¤u§@ªí³æºûÅ@¤¤
  13.      Wend
  14.    
  15.      With Sheets("¤u§@ªí³æºûÅ@")
  16.      Set fd = .Columns(3).Cells.Find(ActiveSheet.Name, LookIn:=xlValues, lookat:=xlWhole) '¦bCÄæ·j´M¤u§@ªí¦WºÙ¤§¤º®e¬Ý¬Ý¨Ï§_¤w¸g¦s¦b¸Óµ§¸ê®Æ
  17.      
  18.         If fd Is Nothing Then
  19.            MsgBox "¤u§@ªí³æºûÅ@¤¤µL¤u§@ªí: " & xR & " ¡A»Ý§ó§ï¤u§@ªí¦WºÙ!", , "§ó§ï¤u§@ªí¦WºÙ!"
  20.            For Each wSheet In Worksheets
  21.            With Sheets("¤u§@ªí³æºûÅ@")
  22.            Set fd = .Columns(3).Cells.Find(Name, LookIn:=xlValues, lookat:=xlWhole) '¦bCÄæ·j´M¤u§@ªí¦WºÙ¤§¤º®e¬Ý¬Ý¨Ï§_¤w¸g¦s¦b¸Óµ§¸ê®Æ
  23.            If wSheet.Name = xR Then
  24. 10            Name = InputBox("½Ð¿é¤J¤u§@ªí¦WºÙ¡I" & vbNewLine & "­ì¦WºÙ:" & wSheet.Name, "§ó§ï¤u§@ªí¦WºÙ", , 8000, 4000) '´£¥Ü
  25.                  i = 1: t = Mid(Name, i, 1)
  26.                  If Len(Name) > 31 Then
  27.                     MsgBox "¤u§@ªí¦WºÙ¤j©ó31­Ó¦r¤¸!": GoTo 10
  28.                  ElseIf Len(Name) = 0 Then
  29.                     MsgBox "¤u§@ªí¦WºÙªÅ¥Õ!": GoTo 10
  30.                  ElseIf InStr(1, code, t) > 0 Then: i = i + 1
  31.                     MsgBox "¤u§@ªí¦WºÙ¦³¯S®í¦r¤¸¡I": GoTo 10
  32.                  ElseIf Not fd Is Nothing Then
  33.                     MsgBox "¤u§@ªí¦WºÙ­«½Æ¡I": GoTo 10
  34.                  Else
  35.                     ActiveSheet.Name = Name
  36.                  End If
  37.            End If
  38.            End With
  39.            Next wSheet
  40.         End If
  41.      End With
  42.      End If
  43.    
  44. End Sub
½Æ»s¥N½X

­×§ï¬¡­¶Ã¯¦WºÙ.zip (29.57 KB)

­×§ï¬¡­¶Ã¯¦WºÙ

¬Ý¤£À´ÅÞ¿è¤Î¬yµ{~~
³Ì¦n³v¨B´y­z~~~

TOP

        ÀR«ä¦Û¦b : ºw¤ô¦¨ªe¡C²É¦Ì¦¨ÅÚ¡A¤Å»´¤vÆF¡A¤Å¥Hµ½¤p¦Ó¤£¬°¡C
ªð¦^¦Cªí ¤W¤@¥DÃD