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

[µo°Ý] Àx¦s®æ¤º®eÅܧó«á¦Û°Ê²¾¨ì¤U¤@®æ

¦^´_ 1# owen06
¨Ï¥Îª«¥óÃþ§O
  1. 'ThisWorkbook¼Ò²Õ
  2. Dim Ar() As New Class1 'ª«¥óÃþ§O¼Ò²Õ [¦WºÙ: Class1]
  3. Private Sub Workbook_Open()  
  4.     Dim E As OLEObject, i As Integer
  5.     With Sheet1
  6.         For Each E In .OLEObjects
  7.             If E.progID = "Forms.CommandButton.1" Then
  8.                 If UCase(E.Object.Caption) <> "CLEAR" And UCase(E.Object.Caption) <> "MADE" Then
  9.                     ReDim Preserve Ar(0 To i)
  10.                     Set Ar(i).Class_CommandButton = E.Object
  11.                     i = i + 1
  12.                 End If
  13.             End If
  14.         Next
  15.        Run "Sheet1.CommandButton2_Click"
  16.     End With
  17. End Sub
½Æ»s¥N½X
  1. Public mysize As Range    'Sheet1¼Ò²Õ
  2. Private Sub CommandButton1_Click()
  3. k1 = [I2].Value
  4. k2 = [i3].Value
  5. Set mysize = [B2].Resize(k1, k2)
  6. mysize.clear
  7. End Sub
  8. Private Sub CommandButton2_Click()
  9. 'Dim mysize As Range
  10. k1 = [I2].Value
  11. k2 = [i3].Value
  12. Set mysize = [B2].Resize(k1, k2)
  13. With mysize
  14. .Borders.LineStyle = xlContinuous
  15. .Interior.ColorIndex = 37
  16. .VerticalAlignment = xlCenter
  17. .HorizontalAlignment = xlCenter
  18. End With
  19. mysize.Cells(1).Select
  20. End Sub
½Æ»s¥N½X
  1. Option Explicit  '·s¼Wª«¥óÃþ§O¼Ò²Õ [¦Û°Ê©R¦W: Class1]
  2. Public WithEvents Class_CommandButton As MSForms.CommandButton
  3. Private Sub Class_CommandButton_Click()
  4.     Dim i As Integer
  5.     With Class_CommandButton.Parent.mysize
  6.         .Cells(Application.CountA(.Cells) + 1) = Class_CommandButton.Caption
  7.     End With
  8. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# owen06
  1. Public mysize As Range   '¼Ò²Õ³»ºÝ¨î©w¬°¦¹¼Ò²Õªº¤½¥ÎÅܼÆ,¨ä¥L¼Ò²Õªºµ{§Ç¥i¨Ï¥Î¦¹ÅܼÆ
  2. 'Dim mysize As Range   '¼Ò²Õ³»ºÝ¨î©w¬°¦¹¼Ò²Õªº¨p¥ÎÅܼÆ,¶È¦¹¼Ò²Õªºµ{§Ç¥i¨Ï¥Î¦¹ÅܼÆ,¨ä¥L¼Ò²Õªºµ{§Ç¤£¥i¨Ï¥Î¦¹ÅܼÆ
  3. Private Sub CommandButton1_Click()
  4. 'Dim mysize As Range  '¦¹µ{§Çªº¨p¥ÎÅܼÆ,¶È¦¹µ{§Ç¤¤¥i¥Î  
  5. k1 = [I2].Value
  6. k2 = [i3].Value
  7. Set mysize = [B2].Resize(k1, k2)
  8. mysize.clear
  9. End Sub
  10. Private Sub CommandButton2_Click()
  11. 'Dim mysize As Range
  12. k1 = [I2].Value
  13. k2 = [i3].Value
  14. Set mysize = [B2].Resize(k1, k2)
  15. With mysize
  16. .Borders.LineStyle = xlContinuous
  17. .Interior.ColorIndex = 37
  18. .VerticalAlignment = xlCenter
  19. .HorizontalAlignment = xlCenter
  20. End With
  21. mysize.Cells(1).Select
  22. End Sub
  23. '«á­±ªºCommandButton??_Click ¤£¦b»Ý­n¤F
  24. Private Sub CommandButton10_Click()
  25. ActiveCell = CommandButton10.Caption
  26. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¤p¨Æ¤£°µ¡B¤j¨ÆÃø¦¨¡C
ªð¦^¦Cªí ¤W¤@¥DÃD