Quantcast
Channel: OKWAVE 最新質問(Visual Basic/257)【本日】
Viewing all articles
Browse latest Browse all 6510

オプションボタン選択でコンボボックス有効

$
0
0
ExcelVBAでユーザーフォームを作成しているのですが、昨日までうまく動作していたことが、突然動かなくなりました。 オプション1を選択 ↓ コンボボックス1有効  ※他のコンボボックスは無効 ↓ オプション2を選択 ↓ コンボボックス2有効  ※コンボボックス1も含め他のコンボボックスは無効 という感じで動作させたいです。 書いたコードはこんな感じです。 Private Sub OptionButton1_Click () Dim i As Long Dim lastRow As Integer lastRow = Cells(Row.Count, 1).End(xlUp).Row If OptionButton1.Value = True Then OptionButton1.Enabled = True With ComboBox1 If ComboBox1 = "" Then For i = 2 To lastRow .AddItem Worksheets("sheet1").Cells(i, 1).Value Next i End If End With ComboBox1.ListIndex = 0 ComboBox2.Enabled = False ComboBox3.Enabled = False End If End Sub コードの間違いや改善点などありましたら教えて下さい。 よろしくお願いします。

Viewing all articles
Browse latest Browse all 6510

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>