Board logo

¼ÐÃD: [µo°Ý] ±qÀx¦s®æ¤¤¸ê®Æ¡A·s«Ø©Î§ä¨ì¤@­Ó¤u§@ªí [¥´¦L¥»­¶]

§@ªÌ: pitera88    ®É¶¡: 2013-6-11 11:25     ¼ÐÃD: ±qÀx¦s®æ¤¤¸ê®Æ¡A·s«Ø©Î§ä¨ì¤@­Ó¤u§@ªí

§Ú·Q­n«Ø¥ß¤@­Ó¦W³æªº¤u§@ªí¡AùØ­±¬O¦W³æªºªí¦C

½Ð°Ý¦p¦ó¥i¥H«ö¦W³æ(¹³¶W³sµ²)´N¥i¥H·s«Ø¤@­ÓªÅ¥Õªº¤u§@ªí(¦³Âªº®æ¦¡ªÅ¥Õ¤u§@ªí¤F)¡A¦pªG¤u§@ªí¦WºÙ¤w¦s¦b¡A´N¶}±Ò¨º­Ó¤u§@ªí¡C

¨Ò¦p¡G¤u§@ªí(¦W³æ)--¤º¦³¡G±i¤T¡A§õ¥|¡A¤ý¤­
        ¤u§@ªí(ªÅ¥Õ¤u§@ªí)
ÂIÀ»¡u±i¤T¡vÀx¦s®æ¡A´N¥i¥H½Æ»s¡uªÅ¥Õ¤u§@ªí¡v¦WºÙ¬O¡u±i¤T¡v¡A¦pªG¡u±i¤T¡v¤u§@ªí¤w¦s¦b«h¶}±Ò¡u±i¤T¡v¤u§@ªí


¥H¤W¡A³Â·Ð¦U¦ì¤j¤j­Ì¤F~~
----------------
¥H«e¦³¥Î¹L¡u«ö¶s¡v¤è¦¡·s«Ø¤u§@ªí

Private Sub CommandButton1_Click()
Dim I As String
  
    I = InputBox("½Ð¿é¤J«È¤á©m¦W.", "Copy Sheet")
    If I <> "" Then
        Sheets(1).Copy After:=Sheets(Sheets.Count) '½Æ»s²Ä¤@­Ó¤u§@ªí¨Ã©ñ¨ì³Ì«á¤@­Ó
        Sheets(Sheets.Count).Name = I              '³Ì«á¤@­Ó¤u§@ªíªº¦WºÙ=I
    Else
        MsgBox "½Æ»s¥¢±Ñ(¸ê®Æªí¥¼¿é¤J¦WºÙ)"
    End If
End Sub

§Æ±æ­n§ó¤è«K¨Ç~~~ ·P®¦~~~~~
§@ªÌ: kimbal    ®É¶¡: 2013-6-11 13:41

¦^´_ 1# pitera88

³o­Ó¬O¿ï¤W¥ô¦ó¤@­Ó®æ¤l®É·|µo¥Í,¦³»Ý­n¥i¥H¥[¤W«ü©w½d³ò
  1. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
  2.     On Error GoTo skip
  3.     Dim I As String
  4.     I = Target.Cells(1, 1).Value
  5.     If I <> "" Then
  6.         Sheets.Add
  7.         ActiveSheet.Name = I
  8.     End If

  9. skip:
  10. End Sub
½Æ»s¥N½X
ºò°O¥N½X­n©ñ¦b¤u§@ªí¸Ì
  [attach]15234[/attach]
§@ªÌ: pitera88    ®É¶¡: 2013-6-11 19:26

¦^´_  pitera88

³o­Ó¬O¿ï¤W¥ô¦ó¤@­Ó®æ¤l®É·|µo¥Í,¦³»Ý­n¥i¥H¥[¤W«ü©w½d³òºò°O¥N½X­n©ñ¦b¤u§@ªí¸Ì
kimbal µoªí©ó 2013-6-11 13:41



    ÁÂÁ¤j¤jªº´£¨Ñ¤èªk¡A
¤£¹L½Ð°Ý¥i¥H¡G1·s¥Í¦¨ªº¤u§@ªí¬O©ñ¦b³Ì«á¡C
¡@¡@¡@¡@¡@¡@¡@¢±¤w¸g¦³ªº¤u§@ªí´N¶}±Ò¤u§@ªí¡A¤£µM·|·s¼Wªº¬O¤@­Ó¡u¢á¢Ö¢Ó¢Ó¢â¢³¡v

·Ð½Ð¤j¤j¤F¡A·P®¦¡I¡I
§@ªÌ: stillfish00    ®É¶¡: 2013-6-13 10:20

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2013-6-13 10:23 ½s¿è

¦^´_ 3# pitera88
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.     If Target.Cells(1, 1).Value = "" Then Exit Sub
  3.    
  4.     On Error GoTo ADD_SH
  5.     Sheets(Target.Cells(1, 1).Value).Select
  6.     On Error GoTo 0
  7.    
  8.     Exit Sub
  9.    
  10. 'Error handle
  11. ADD_SH:
  12.     With Sheets.Add(After:=Sheets(Sheets.Count))
  13.         .Name = Target.Cells(1, 1).Value
  14.     End With
  15.     Resume Next
  16. End Sub
½Æ»s¥N½X

§@ªÌ: pitera88    ®É¶¡: 2013-6-14 12:36

¦^´_  pitera88
stillfish00 µoªí©ó 2013-6-13 10:20



    stillfish00 ¤j¤j¡A§Ú§âµ{¦¡½X¶K¤W¥h¡A¥i¬O³£¨S¦³°Ê§@­C~~

¦³¤j¤j¥i¥H¸Õ¬Ý¬Ý¶Ü?? ·P®¦!!!!!!
§@ªÌ: pitera88    ®É¶¡: 2013-6-14 12:58

¦^´_ 5# pitera88


    ÁÙ¬O¦³¤j¤j¥i¥H§i¶D§Ú¡A
1¡D§PÂ_³o­Ó¦W¦rªº¤u§@ªí¡A¬O§_¤w¦s¦b?  ³o­Ó©R¤µ­n«ç»ò¼g??

2¡D¶}±Ò«ü©w¤u§@ªíªº©R¥O¬O¤£¬O ¡uWorksheets("¦W¦r").Activate¡v??


·P®¦!!!!!
§@ªÌ: Hsieh    ®É¶¡: 2013-6-14 15:08

¦^´_ 6# pitera88

[attach]15248[/attach]
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2. If Target.Count > 1 Or Target.Column <> 1 Then Exit Sub
  3. Application.EnableEvents = False
  4. If Target <> "" Then
  5.    On Error GoTo addsheet
  6.    Sheets(CStr(Target)).Select: GoTo 10
  7.    
  8. addsheet:
  9. MsgBox Target & "¤u§@ªí¤£¦s¦b"
  10.    With Sheets.Add(after:=Sheets(Sheets.Count))
  11.    .Name = CStr(Target)
  12.    End With
  13. End If
  14. 10
  15. Application.EnableEvents = True
  16. End Sub
½Æ»s¥N½X

§@ªÌ: stillfish00    ®É¶¡: 2013-6-14 15:38

¦^´_ 5# pitera88
Sorry¡AResume Next «e­±º|±¼Err.Clear
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  2.     Application.EnableEvents = False

  3.     If Target.Cells(1, 1).Value = "" Then Exit Sub   
  4.     On Error GoTo ADD_SH
  5.     Sheets(Target.Cells(1, 1).Value).Select
  6.     On Error GoTo 0

  7.     Application.EnableEvents = True   
  8.     Exit Sub
  9.    
  10. 'Error handle
  11. ADD_SH:
  12.     With Sheets.Add(After:=Sheets(Sheets.Count))
  13.         .Name = Target.Cells(1, 1).Value
  14.     End With
  15.     Err.Clear
  16.     Resume Next
  17. End Sub
½Æ»s¥N½X
¡C




Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)