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

[µo°Ý] ¦p¦ó§Ö³tÅÜ´«Workbook_Openªº¨âºØ¥\¯à»Ý¨D?

¦^´_ 1# av8d
  1. Option Explicit
  2. Private Sub Workbook_Open()
  3.     '¨Ò¦p§Ú»s§@¨â­ÓOptionButton¡A¤À§O©R¦W¬°A1©MZ1
  4.     '**--- ¨â­ÓOptionButton  ¬O¦P¤@¸s²Õ
  5.     Dim e As Shape, Rng As Range
  6.     With Sheets("Sheet1")
  7.         For Each e In .Shapes
  8.             If e.Name = "A1" Or e.Name = "Z1" Then
  9.                 If e.Type = 12 Then                     '±±¨î¤u¨ã½c¤u¨ã¦Cªº OptionButton
  10.                     If .OLEObjects(1).Object.Value Then Set Rng = .Range(e.Name)
  11.                 ElseIf .Shapes(1).Type = 8 Then         'ªí³æ¤u¨ã¦Cªº Option Button
  12.                     If e.OLEFormat.Object.Value Then Set Rng = .Range(e.Name)
  13.                 End If
  14.             End If
  15.           Next
  16.     End With
  17. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¤H­nª¾ºÖ¡B±¤ºÖ¡B¦A³yºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD