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

[µo°Ý] ½Ð±Ð¦p¦ó²¤Æ«ü¥O¤Î¦b¦p¦ó¤@¯ë¼Ò²Õ¤¤¨Ï¥Î

[µo°Ý] ½Ð±Ð¦p¦ó²¤Æ«ü¥O¤Î¦b¦p¦ó¤@¯ë¼Ò²Õ¤¤¨Ï¥Î

½Ð±Ð¦U¬°¥ý¶i, ¤p§Ìµ{¦¡½X¦p¤U, ­ì¥»¤p§Ì·Q¨Ï¥ÎFor.....Next°j°é¨Ó§PÂ_CÄæ¬O§_¦³¸ê®Æ¨Ã±±¨î CommandButtonÅã¥Ü»P§_
¦ý¬O¥d¦b ±±¨î¶µª«¥óªº³¡¥÷, ¤p§Ì¤£·|¨Ï¥ÎFor...Next¨Ó¼g...¦A½Ð¦U¦ì¥ý¶i«ü¾É¤@¤U.

¥t¥~¦]©Ò¦³ªºsheet³£·|¥Î¨ì¸Óµ{¦¡, ¦]¦¹¤p§Ì·s¼W©ó¤@¯ë¼Ò²Õ, ¥i¬O¨C·í°õ¦æ«á, ·|¥X²{"¦¹³B»Ý­nª«¥ó"ªº¿ù»~°T®§
¬ÝExcelªº»¡©ú»¡§Ú¤Ö¤F«ü©wªº©w¦ì¶µ, ¤p§Ì¤£¤ÓÁA¸Ñ©w¦ì¶µªº·N«ä¥H¤Î¸Ó©ñ¦b¨ºÃä...¦³³Ò¦U¦ì¥ý¶i¶}¾É, ÁÂÁÂ!!
  1. Sub RemoveButton()

  2. If [C3] <> "" Then
  3.     CommandButton2.Visible = True
  4.     Else
  5.     CommandButton2.Visible = False
  6. End If

  7. If [C4] <> "" Then
  8.     CommandButton3.Visible = True
  9.     Else
  10.     CommandButton3.Visible = False
  11. End If

  12. If [C5] <> "" Then
  13.     CommandButton4.Visible = True
  14.     Else
  15.     CommandButton4.Visible = False
  16. End If

  17. If [C6] <> "" Then
  18.     CommandButton5.Visible = True
  19.     Else
  20.     CommandButton5.Visible = False
  21. End If

  22. If [C7] <> "" Then
  23.     CommandButton6.Visible = True
  24.     Else
  25.     CommandButton6.Visible = False
  26. End If

  27. If [C8] <> "" Then
  28.     CommandButton7.Visible = True
  29.     Else
  30.     CommandButton7.Visible = False
  31. End If

  32. If [C10] <> "" Then
  33.     CommandButton8.Visible = True
  34.     Else
  35.     CommandButton8.Visible = False
  36. End If

  37. If [C11] <> "" Then
  38.     CommandButton9.Visible = True
  39.     Else
  40.     CommandButton9.Visible = False
  41. End If

  42. If [C12] <> "" Then
  43.     CommandButton10.Visible = True
  44.     Else
  45.     CommandButton10.Visible = False
  46. End If

  47. If [C13] <> "" Then
  48.     CommandButton11.Visible = True
  49.     Else
  50.     CommandButton11.Visible = False
  51. End If

  52. If [C14] <> "" Then
  53.     CommandButton12.Visible = True
  54.     Else
  55.     CommandButton12.Visible = False
  56. End If

  57. If [C15] <> "" Then
  58.     CommandButton13.Visible = True
  59.     Else
  60.     CommandButton13.Visible = False
  61. End If

  62. If [C16] <> "" Then
  63.     CommandButton14.Visible = True
  64.     Else
  65.     CommandButton14.Visible = False
  66. End If

  67. If [C17] <> "" Then
  68.     CommandButton15.Visible = True
  69.     Else
  70.     CommandButton15.Visible = False
  71. End If

  72. End Sub
½Æ»s¥N½X

¦^´_ 1# dino1978

³o°ÝÃD¦b©óµ{¦¡½X¬O±±¨î¤u§@ªí¤ºªº«ö¶sÅã¥Ü±¡§Î
­Y¬O¨C­Ó¤u§@ªíªº«ö¶s¦WºÙ¤£¦P¡A¨º´NµLªk¨Ï¥Î¦¹µ{¦¡½X­×§ï
©Ò¥H¡A§A³o¼Ëªº°ÝÃD¥²¶·½T»{¨C­Ó¤u§@ªíªº«ö¶s¦WºÙ¬O§_¬Û¦P
¦A¨Ó´N¬O§AÅX°Ê¥¨¶°ªº¤è¦¡¬°¦ó?¦b¤@¯ë¼Ò²Õ¤º­n°õ¦æµ{¦¡¡A¥i¨Ï¥Î§Ö³tÁä©Î«ö¶sµ¥¤èªk
©Ò¥H°õ¦æµ{¦¡ªº¤èªk¤]·|¼vÅTµ{¦¡ªº¼¶¼g
«Øij±z¤W¶ÇÀɮ׬ݬÝ
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 1# dino1978
¥²¶·¬O¨C­Ó¤u§@ªí³£¦³CommandButton2 - CommandButton18ªº±±¨î¶µ
  1. Option Explicit
  2. Sub RemoveButton()
  3.     Dim I As Integer
  4.     With ActiveSheet
  5.         For I = 3 To 17
  6.             If .Cells(I, "C") <> "" Then
  7.                  .OLEObjects("CommandButton" & I - 2).Visible = True
  8.             Else
  9.                 .OLEObjects("CommandButton" & I - 2).Visible = False
  10.             End If
  11.         Next
  12.     End With
  13. End Sub
½Æ»s¥N½X

TOP

TR6850 configure.zip (310.03 KB)
¦^´_ 2# Hsieh
¶Wª©¤j¤j, «Ü©êºp³o»ò±ß¤~¦^Âбz, §ÚªºªþÀɦpªþ¥ó, ¤w°Ñ·ÓGBKEE¤j¤jªº«ü¥Oµy§@­×§ï§¹¦¨, ÁÂÁ±zªº¨ó§U

¦^´_ 3# GBKEE
GBKEE ª©¤j, ÁÂÁ±zªºÀ°¦£, µ{¦¡·Ó±zªº¤èªkµy§@­×§ï¤w¸g¥i¥H¨Ï¥Î  ÁÂÁÂ

¨Ã¯¬§A­Ì·s¬K´r§Ö!!

TOP

¦^´_ 4# dino1978
ÁÙ¦³¥i²¤Æ
  1. Private Sub CommandButton10_Click()
  2.     ASlotRemove [C12]   '¶Ç°e°Ñ¼ÆMyText : [C12]
  3. End Sub
  4. Private Sub CommandButton11_Click()
  5.     ASlotRemove [C13]   '¶Ç°e°Ñ¼ÆMyText : [C13]
  6. End Sub
  7. Private Sub CommandButton12_Click()
  8.     ASlotRemove [C14]    '¶Ç°e°Ñ¼ÆMyText : [C14]
  9. End Sub
½Æ»s¥N½X
  1. Sub SlotRemove(ByVal MyText As Range)   '±µ¦¬°Ñ¼Æ MyText
  2.     Application.ScreenUpdating = False
  3.     Dim Rng As Range, F_Address As String, TheFind As String, a As Range
  4.     'MyText = [C12] ' Trim(InputBox("½Ð¿é¤J­n´M§äªº­È:"))
  5.     If MyText <> "" Then
  6.         Set Rng = Sheet3.Range("A1").CurrentRegion.EntireColumn.Find(MyText, lookat:=xlWhole)
  7.         If Not Rng Is Nothing Then
  8.             F_Address = Rng.Address
  9.             Do
  10.                 TheFind = IIf(TheFind = "", Rng.Address(0, 0), TheFind & "   " & Rng.Address(0, 0))
  11.                 Set Rng = Sheet3.Range("A1").CurrentRegion.EntireColumn.FindNext(Rng)
  12.             Loop Until F_Address = Rng.Address
  13.         End If
  14.         Else: GoTo err2
  15.     End If
  16.     If TheFind <> "" Then
  17.         If Rng Is Nothing Then
  18.             GoTo err
  19.         Else
  20.           Sheet2.Range("A65536").End(xlUp).Offset(1) = Rng
  21.             With Rng.Resize(1, 3)
  22.                 .Delete xlShiftUp
  23.             End With
  24.             With Range("B12")
  25.                 .Resize(1, 2).ClearContents
  26.                 .ClearContents
  27.                 .Offset(, 1).Validation.Delete
  28.             End With
  29.         End If
  30.     Else
  31. err:
  32.         MsgBox "¨S¦³§ä¨ì  " & MyText
  33. err2:
  34.     End If
  35.     TheFind = ""
  36.     Application.ScreenUpdating = True
  37. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ dino1978 ©ó 2012-1-28 06:04 ½s¿è

¦^´_ 5# GBKEE


    GBKEEª©¤j,
   ­ì¨ÓÁÙ¦³³o©Û¥i¥H¥Î, ¯uªº¬O¾Ç¨ì¤F
   ¤£¹L§Ú±N¸Óµ{¦¡½XÀ³¥Î¦b¤W­±ªº®É­Ô, µo¥Í¦p¤U¹Ïªº¿ù»~°T®§,
   ¬Ý¤F¦Ñ¥b¤ÑÁÙ¬O¤£ª¾¹D°ÝÃD¥X¦b­þ, §Ú¨Ã¨S¦³°Ê¨ì¨ä¥LªºÄæ¦ì
   ¦ý°õ¦æ«á´N¥X²{¤F³o­Ó¿ù»~°T®§, ¦A½Ð±zÀ°§Ú½T»{¤@¤U, ÁÂÁ±z
   (­Y§ï¦^­ì¨Óªº¤è¦¡, ´N¤£·|¥X²{³o­Ó°ÝÃD¤F, ¤£¤Ó²z¸Ñ.....)
Â^¨ú1.JPG

TOP

¦^´_ 6# dino1978
½Ð¤W¶Ç§A­×§ï«áªºÀɮ׬ݬÝ

TOP

¦^´_ 7# GBKEE

GBKEE ª©¤j
   ¤£¦n·N«ä, §Ú¤Ó½ÞÀY¤F, §Ú§Ñ¤F±Nªº¼Ò²Õ²¾°£³y¦¨½Ä¬ð, ²{¦b°ÝÃD¤w¸g¸Ñ¨M¤F
¤Ó·PÁ±z¤F~¾ã­Ó¬Ý°_¨Ó´N²M²n¦h¤F!!

¥t¥~·Q½Ð±Ðªº¬O CheckBox ±±¨î¶µ¬O§_¤]¯à°÷¹³ CommandButton¤@¼Ë¥Î OLEobjectsªº¤è¦¡¨Ó°µLoop©O?
§Ú¦³¦Û¤v¤p¸Õ¤F¤@¤U, ·|¥X²{ "ª«¥ó¤£¤ä´©¦¹ÄݩʩΤèªk"
¬O§Úªº»yªk¿ù»~ÁÙ¬OCheckBox±±¨î¶µ¤£¯à³o¼Ë¨Ï¥Î?
  1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)

  2. Dim i As Integer

  3. i = 1

  4. With Sheet1
  5. .OLEObjects("CheckBox" & i).Value = False
  6. End With

  7. End Sub
½Æ»s¥N½X

TOP

¦^´_ 8# dino1978
.OLEObjects("CheckBox" & i).Value = False
§ï¦¨
.OLEObjects("CheckBox" & i).Visible = False

TOP

¦^´_ 9# GBKEE

GBKEE ª©¤j,
   §Úªº·N«ä¬O, §Ú·Q¦bWorkbook¶}±Ò«á, ¦Û°Ê±N©Ò¦³ªºCheckBox±±¨î¶µ¨ú®ø®Ö¨ú,
©Ò¥H§Ú¤~·|§âµ{¦¡§ï¦¨ .Value=False,  ¤£ª¾³o¼Ë¥i¤£¥i¦æ¶Ü?

TOP

        ÀR«ä¦Û¦b : «Î¼e¤£¦p¤ß¼e¡C
ªð¦^¦Cªí ¤W¤@¥DÃD