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

[µo°Ý] ¦p¦óÅý¤w©w¸q¥¨¶°ªº«ö¶s¦b¤Á´«¤£¦P¤À­¶®É³£¥i³Q¬Ý¨ì(¤w¸Ñ¨M)

[µo°Ý] ¦p¦óÅý¤w©w¸q¥¨¶°ªº«ö¶s¦b¤Á´«¤£¦P¤À­¶®É³£¥i³Q¬Ý¨ì(¤w¸Ñ¨M)

¥»©«³Ì«á¥Ñ swatt ©ó 2011-7-11 13:37 ½s¿è

½Ð°Ý¦U¦ì°ª¤â¤j¤j,
§Ú¤w¸g©w¸q(³sµ²)¬Y­Ó¥¨¶°µ¹¤@­Ó«ö¶s¡A¨Ã§Æ±æ¦b¤Á´«¤£¦P¤À­¶(sheet)®É¡A¦¹«ö¶s³£¥i³Q¬Ý¨ì(§Y¥i«ö¤U°õ¦æ)¡A
¤]´N¬OÅý¦¹«ö¶s¤@ª½ on the top¡A¤£·|¦b¤Á´«¤À­¶®É³Q»\±¼¡A½Ð°Ý¸Ó¦p¦ó°µ©O?

¦p¹Ï¡A§â¯ºÁy©Ô¨ì¤u¨ã¦C¤W¡A«ü©w¥¨¶°¡C

TOP

¦^´_ 2# chin15


¨ü±Ð¤F¡AÁÂÁ¡I¥t¥~¥i§_½Ð±Ð§A¬O§_ª¾¹D¦p¦ó¬d¬Ý¨ì´¡¤J¦WºÙ¡ã©w¸qªºÁ`¦W³æ¡H¦]¬°¥¦¦n¹³¬O­Ó§OÀɮ׸̤~¬Ý±o¨ì¡A­Y¦³¤£¦PÀɦW³]¤F¬Û¦Pªº©w¸q¦W¦r¦³Ãö«Y¶Ü¡H©Î³\À³¸Ó´«­Ó¤è¦¡½Ð°Ý¡G¤£¦PÀɮקY¨Ï©w¸q¦W¦r¬Û¦P¤]µL§«¡A¬O¶Ü¡H

TOP

·PÁÂ chin15 ¤j¤j,
·s¼W¤u¨ã¦Cªº¤è¦¡¤ñ§Ú¦Û¤v¥i·Q¨ì¤èªk¦n¦h¤F¡C

TOP

¦A½Ð°Ý¤@¤U ,
§Ú·s¼W¤@­Ó¤u¨ã¦C¡A¨Ã¥[¶i¥h¤w©w¸q¥¨¶°ªº«ö¶s¡A³o¼Ë¥i¥H¹F¦¨¥Øªº¡C
¥i¬O³o¼Ë·s¼Wªº¤u¨ã¦C¦b¨C­Óworkbook³£¥i¬Ý±o¨ì¡A
¥i§_±N¥¦«ü©w¦¨¥u¦³¬Y­Óworkbook±MÄݪº¤u¨ã¦C¶Ü?

TOP

´¿¦¬¶°¨ìÃþ¦ü¤À¨É¡A¥HVBA ¼g©ó  Workbook  ¶}±Ò¦Û©w¸q«ö¶s¡A©óÃö³¬Àɮ׮ɧR°£
¦ý¥¼¸Ô²Ó¬ã¨s¨ä¼gªk¡A¥u§ó§ï¦Û¤v±ý©w¸qªº¦a¤è
¥i¶}±Òªþ¥ó¦Û¦æ¬ã¨s§Y¥i¡A­Y¹ï VBA ¦³°ò¦À³¸Ó¥i»´©öª¾¹D¸Ó§ó§ï¦a¤è
­Y·Qª¾¹D¸Ô²Ó¼gªk§t·N¡A»Ý¨ä¥L°ª¤â¨ó§UÄÀºÃ¡A
§Ú¥uª¾¹D¬Y¨Ç°Ï¶ô¡A§Æ±æ¦³À°§U

´ú¸Õ­Ó¤Hªí³æ¥¨¶°.rar (8.79 KB) ¤è¦¡

¥D­nVBA ¦p¤U

Private Sub Workbook_BeforeClose(Cancel As Boolean)
   
Sheets("´ú¸Õ").Select
On Error Resume Next
   Application.CommandBars("MyMenu").Delete
   Application.CommandBars("ply").Controls("­Ó¤H¾Þ§@ªí³æ").Delete
   
   
End Sub

Private Sub Workbook_Open()

Sheets("´ú¸Õ").Select

On Error Resume Next
   Application.CommandBars("MyMenu").Delete
   Application.CommandBars("ply").Controls("­Ó¤H¾Þ§@ªí³æ").Delete
   
Dim MyMenuBar As CommandBar
Dim MyButton As CommandBarButton

Set MyMenuBar = Application.CommandBars.Add
   With MyMenuBar
     .Visible = True
     .Name = "MyMenu"
     .Position = msoBarTop
    Set MyButton = .Controls.Add
      With MyButton
         .Visible = True
         .Caption = "­Ó¤H¾Þ§@ªí³æ(&P)"
         .Style = msoButtonIconAndCaption
         .FaceId = 988
         .OnAction = "´ú¸Õ­Ó¤Hªí³æ¥¨¶°"
      End With
   End With
   
   Set MyButton = Application.CommandBars("ply").Controls.Add(msoControlButton, , , 1)
      With MyButton
         .Caption = "­Ó¤H¾Þ§@ªí³æ"
         .Visible = True
         .FaceId = 456
         .OnAction = "´ú¸Õ­Ó¤Hªí³æ¥¨¶°"
      
      End With
      


   
End Sub

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
On Error Resume Next
If Workbooks.Count = 1 Then
   Application.CommandBars("MyMenu").Controls("­Ó¤H¾Þ§@ªí³æ(&P)").Enabled = False

End If

End Sub

TOP

·PÁÂ Happkkevin ¤j¤j,
­ì¨ÓÅÞ¿è¬OÂǵ۶}±Ò/Ãö³¬ÀɮסA¨Ó¶}±Ò/Ãö³¬¤u¨ã¦C¡A
¤S¾Ç¨ì¤@©Û¡AÁÂÁ°Õ~

TOP

        ÀR«ä¦Û¦b : ·R¤£¬O­n¨D¹ï¤è¡A¦Ó¬O­n¥Ñ¦Û¨­ªº¥I¥X¡C
ªð¦^¦Cªí ¤W¤@¥DÃD