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

[µo°Ý] ¦p¦ó¥Î¿ï¶µ¶s¤è¦¡¨Ó¿é¤J¸ê®Æ¡H

[µo°Ý] ¦p¦ó¥Î¿ï¶µ¶s¤è¦¡¨Ó¿é¤J¸ê®Æ¡H

¥»©«³Ì«á¥Ñ q1a2z5 ©ó 2011-5-4 08:59 ½s¿è

¦p¦ó¥Î¿ï¶µ¶s¤è¦¡¦b¢Ï¢°¦Ü¢Ï¢°¢¯¢¯¨Ì§Ç¿é¤J¸ê®Æ©O¡H
ÁÂÁ¡I

ªþ¥ó.JPG (56.44 KB)

ªþ¥ó.JPG

­Y¥u¦³³o´X­Ó¿ï¶µ¡A´N¤À§O¼gClick¨Æ¥ó
Private Sub OptionButton1_Click()
Dim r As Range
With ActiveSheet
Set r = IIf(.[a1] = "", .[a1], .[a65536].End(3)(2, 1))
r = OptionButton1.Caption
End With
End Sub
----------------------------------------
Private Sub OptionButton2_Click()
Dim r As Range
With ActiveSheet
Set r = IIf(.[a1] = "", .[a1], .[a65536].End(3)(2, 1))
r = OptionButton2.Caption
End With
End Sub
¦hªº¸Ü´N¥Îª«¥óÃþ§O¼Ò²Õ§@­Ó¶°¦X¡A«ü©wClick¨Æ¥ó
³o¼Ë§A¶·­nªþÀɮפW¨Ó

TOP

ÁÂÁ§Aªº¸Ñµª¡A§Ú±N¿ï¶µ¶s¤À¬°¥|°Ï¡AFrame1¦b¢ÏÄæ¦ì¿é¤J¸ê®Æ¡FFrame2¦b¢ÐÄæ¦ì¿é¤J¸ê®Æ¡A¨Ì¦¹Ãþ±À¡D¡D
¨Ã¥B±Nµ{¦¡½X½Æ»s¤@¤j¦ê¬Ý°_¨Ó§óÁcÂø¤F¡A¦p¦ó±Nµ{¦¡½X²³æ¤Æ©O¡H

ÁÂÁ¡I

ªþ¥ó.rar (10.39 KB)

TOP

¦^´_ 3# q1a2z5
UserFormµ{¦¡½X
  1. Dim MyOp() As New Class1
  2. Private Sub UserForm_Initialize()
  3.     Dim E As MSForms.Control, OP As MSForms.OptionButton, i%
  4.     For Each E In Controls
  5.         If E.Name Like "Frame*" Then
  6.             For Each OP In E.Controls
  7.                 ReDim Preserve MyOp(i)
  8.                 Set MyOp(i).OP = OP
  9.                 i = i + 1
  10.             Next
  11.         End If
  12.     Next
  13. End Sub
½Æ»s¥N½X
¨Ï¥Îª«¥óÃþ§O¼Ò²Õ
  1. Option Explicit
  2. Public WithEvents OP As MSForms.OptionButton
  3. Private Sub OP_Click()
  4.     Dim R As Range, C%
  5.     C = Right(OP.Parent.Name, 1)
  6.     With ActiveSheet
  7.         Set R = IIf(.Cells(1, C) = "", .Cells(1, C), .Cells(Rows.Count, C).End(3)(2, 1))
  8.             R = OP.Caption
  9.     End With
  10. End Sub
½Æ»s¥N½X
¦p¹Ï

TOP

¥»©«³Ì«á¥Ñ q1a2z5 ©ó 2011-12-21 22:14 ½s¿è

¦pªGFrame1¿ï¶µ­n±qB2¡FFrame2¿ï¶µ«h±qC2¶}©l¶ñ¤J¡A­n¦p¦ó­×§ï©O¡H

ÁÂÁ¡I

TOP

¦^´_ 5# q1a2z5
  1. Option Explicit
  2. Public WithEvents OP As MSForms.OptionButton
  3. Private Sub OP_Click()
  4.     Dim R As Range, C%
  5.     C = Right(OP.Parent.Name, 1) + 1
  6.     With ActiveSheet
  7.         Set R = IIf(.Cells(1, C) = "", .Cells(1, C), .Cells(Rows.Count, C).End(3)(2, 1))
  8.             R = OP.Caption
  9.     End With
  10. End Sub
½Æ»s¥N½X

TOP

ª©¥D¤j¤j±z¦n¡G
   
     ¨Ï¥Îª«¥óÃþ§O¼Ò²Õªº
¥\®Ä¦p¦¹±j¤j¡C
   ¤p§Ì¤w±N¦¹½d¨Ò¦¬ÂáA
¤é«á¦AºCºCÅé·|¡C
   ¥t¤W­z»yªk¤p§Ì¦³¨ÇµLªk»â·|¡A
½Ðª©¥D¯à¦A¸Ô­z¡C
¤@¡B
ReDim Preserve MyOp(i)
Set MyOp(i).OP = OP '³]©wMYOP(I)¬O¦ó§@¥Î©O¡H
i = i + 1

¤G¡B
C = Right(OP.Parent.Name, 1) + 1
OP.Parent.Name¬O¦ó§t·N©O¡H


ÁÂÁª©¥D¤j¤j¡I

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-12-23 18:13 ½s¿è

¦^´_ 7# dechiuan999
Dim MyOp() As New Class1    ->·sªº Class1(ª«¥óÃþ§O¼Ò²Õ)
MyOp() ¬°°ÊºA°}¦C
ReDim Preserve MyOp(i)  ->°}¦Cºû¼Æ¤U­­·s¼W¨ìi  
              Preserve  -> ¤£§ïÅÜ°}¦C­ì¦³¤º®e
Set MyOp(i).OP = OP  -> ·s¼Wªº MyOp(i).OP=OP
   
OP.Parent.Name   ->¤÷¼h  Frame

TOP

ÁÂÁª©¥D¤j¤j¦p¦¹
¸Ô²Ó»¡©ú¡A¤p§Ì¤w¯à²z¸Ñ¡C
¥u¬O¦Ü¤µ©|¥¼»â·|ª«¥óÃþ§O¼Ò²Õ
ªº¹B¥Î¤è¦¡¡C¤]¥u¯à´Á«Ý¦­ÂI»â·|¨ä
¥Î·N»P¤èªk¤F¡C

·P®¦¤j¤j¡I

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD