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

[µo°Ý] (¤w¸Ñµª¡AG¤jÁÂÁÂ)¦p¦óÅý¦Û­qªí³æÃö³¬«á¼È¦s¡A¶}±Ò«áÄ~Äò§@·~¡H

¦^´_ 10# dafa
¶·¬O§A»¡ªº:§â©Ò¦³CommandButton¹ïÀ³Àx¦s®æ¦A¦s¤J¹ïÀ³ªºÀɦW¤~¯à¸Ñ¨M ÀɦW¦s©óSheets("¤u§@ªí1")¸Ì¤~¯à¦p§A©ÒÄ@
½Ð­×§ïGW4501ªí³æUserForm_Initializeµ{¦¡½X ¦p¤U
  1. Option Explicit
  2. 'Public dw  'GW45011ªí³æ¤£¶·«Å§i: [Module1]¼Ò²Õ¤w«Å§i¹L
  3. Public Sh As Worksheet   '¶··s¥[¤½¥ÎÅÜ¼Æ [TheButton] ¼Ò²Õ¤~¥i¤Þ¥Î
  4. Dim ButtonClass() As New TheButton
  5. Private Sub UserForm_Initialize()
  6. Dim E As Control, i As Integer
  7. Dim hWnd, tPath, oo
  8. GW4501.Height = Sheets("¤u§@ªí3").Cells(3, 7) / 5
  9. GW4501.Width = Sheets("¤u§@ªí3").Cells(3, 2) / 5
  10. hWnd = GetForegroundWindow
  11. tPath = ActiveWorkbook.Path & "\©³¹Ï\"
  12. 'tPath = Application.GetOpenFilename("EXCEÀÉ(*.XLS),*xls")'
  13. [c1] = tPath
  14. oo = Dir(tPath)
  15. If oo = "" Then
  16.     MsgBox "§A©³¹Ï¸ê®Æ§¨¤º¨S©ñ¶i¹ÏÀÉ"
  17.     End
  18. Else
  19.     [c2] = tPath & oo
  20.     GW4501.Picture = LoadPicture(tPath & oo)
  21. End If
  22. 'ButtonClassÅܼƳ]©w¬° New TheButtonª«¥óÃþ§O¼Ò²Õ
  23. Set Sh = Sheets("¤u§@ªí1")   '¤u§@ªíÀx¦s¹Ïªí¸ô®|
  24. With Sh
  25.     For Each E In Me.Controls
  26.         If InStr(E.Name, "CommandButton") Then
  27.             i = i + 1
  28.             ReDim Preserve ButtonClass(1 To i)
  29.             Set ButtonClass(i).Button = E     '«ü©w TheButton.Button(i) ªºª«¥ó
  30.             '*** CommandButton¹ïÀ³Àx¦s®æ¦A¦s¤J¹ïÀ³ªºÀɦW ***
  31.             E.ControlTipText = Cells(i, "A").Address(0, 0) & ":"
  32.             If Dir(.Cells(i, "A").Text) <> "" Then
  33.                 E.Picture = LoadPicture(.Cells(i, "A").Text)
  34.                 E.ControlTipText = E.ControlTipText & .Cells(i, "A")
  35.                 'CommandButtonªºControlTipText= .Cells(i, "A")ªº¦C¦W¤Î¤º®e(ÀɦW)
  36.             End If
  37.         End If
  38.     Next
  39. End With
  40. End Sub
½Æ»s¥N½X
½Ð­×§ïTheButton¼Ò²Õ¤º
  1. Option Explicit
  2. Public WithEvents Button As MSForms.CommandButton
  3. Private Sub Button_Click()
  4.     Dim S
  5.     S = Split(Button.ControlTipText, ":")
  6.     If S(1) = "" Then
  7.         Call ´Óª«
  8.         Button.Picture = LoadPicture(dw)
  9.         Button.ControlTipText = Button.ControlTipText & dw
  10.         S = Split(Button.ControlTipText, ":")
  11.         GW4501.Sh.Range(S(0)) = dw
  12.          'CommandButton¹ïÀ³ªºÀx¦s®æ¦s¤J: ÀɦW
  13.         dw = ""
  14.     End If
  15. End Sub
½Æ»s¥N½X

TOP

¦^´_ 11# GBKEE


    ·PÁÂG¤j¤£Ã㨯­W¦aÀ°§Ú¸Ñµª
     §Ú¥Ø«e¤W¯Z¤¤
     ¤U¯Z¦^®a¦A¸Õ¸Õ¬Ý
      ·P®¦³á~

TOP

¦^´_ 11# GBKEE


    ·PÁÂG¤j
     ²×©ó¥Î¦n¤F
     ¦ýµ{¦¡ÁÙ­n®ø¤Æ¤@¤U
     ª«¥ó¼Ò²ÕÁÙ¬O·d¤£À´¨Ï¥Î®É¾÷ÁÙ¦³¦n³B¦b­þ?
     ¬°¤°»òª«¥ó¼Ò²Õ¨º»ò¤Ö¨£¨ì¤H®a¦b¨Ï¥Î?
     ÁÙ¬OÁÂÁ§Aªº¼ö¤ß^^

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-12-10 07:52 ½s¿è

¦^´_ 13# dafa
¬°¤°»òª«¥óÃþ§O¼Ò²Õ¨º»ò¤Ö¨£¨ì¤H®a¦b¨Ï¥Î
¤j¦h¨Ï¥Î¨ì¤j¶qªº¬Û¦Pª«¥ó©Î¬O¥Îµ{¦¡½X«Ø¥ßªºª«¥ó: °µ¦P¼Ëªº¥\¯à,´N¤£¥²¦b¨C¤@ª«¥ó¼Ò²Õ¤¤¼g¤Uµ{¦¡½X,
¦pªG¬O ª«¥ó ¬OSheet (¤u§@ªí)©ÎWorkbook(¬¡­¶Ã¯),¨ºThisWorkbook¼Ò²Õ¤¤ Workbook¹w³]¨Æ¥óµ{¦¡: ´N¬O ¸Óª«¥óÃþ§O¼Ò²Õ

TOP

¦^´_ 14# GBKEE


    ·PÁÂG¤jÅý§Ú¤S¾Ç¨ì¤F
                                     ÁÂÁÂ~

TOP

        ÀR«ä¦Û¦b : ½_ÁJµ²±o¶V¹¡º¡¡A¶V·|©¹¤U««¡A¤@­Ó¤H¶V¦³¦¨´N¡A´N­n¶V¦³Á¾¨Rªº¯ÝÃÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD