Results of 1 - 1 of about 9086 for リスト (0.007 sec.)
- [[20200911184145]]
- #score: 2730
- @digest: 02a7febfce95aebfea29b8e87b1d0681
- @id: 85144
- @mdate: 2020-09-11T14:31:35Z
- @size: 1691
- @type: text/plain
- #keywords: サオ (18595), 択li (6590), マサ (5844), listcount (5079), selected (3076), トen (2261), ト( (2002), 数選 (1635), トas (1562), 択さ (1561), ト& (1548), 数デ (1499), が選 (1458), す教 (1455), リス (1334), らa5 (1316), list (1243), らa3 (1123), listbox1 (1120), ト() (1042), ト= (1009), 太様 (967), スト (868), 選択 (851), オ)
(815), commandbutton1 (784), 代入 (744), 半平 (689), 平太 (672), らa1 (583), に代 (576), 金) (467)
- 『複数選択された行の値を取得してセルに代入する』(マサオ)
複数選択された行の値を取得してセルに代入するコード Private Sub CommandButton1_Click() Dim リスト As String Dim i As Integer With ListBox1 For i = 0 To .ListCount - 1 If .Selected(i) = True Then リスト = リスト & .List(i) & vbCrLf End If Next i End With Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Value = リスト 上記では改行で複数データがA2しかはいらない 上記のコードを書き換えてList(i)の1が選択されたらA1 3が選択されたらA3に5が選択されたらA5に入力したいのです教えたください。 End Sub < 使用 Excel:Excel2019、使用 OS:Windows10 > ---- > List(i)の1が選択されたらA1 3が選択されたらA3に すると、こうですか。 Private Sub CommandButton1_Click() Dim リスト() As String Dim i As Integer With ListBox1 ReDim リスト(1 To .ListCount, 1 To 1) For i = 0 To .ListCount - 1 If .Selected(i) = True Then リスト(i + 1, 1) = .List(i) End If Next i Range("A1").Resize(.ListCount) = リスト End With End Sub (半平太) 2020/09/11(金) 19:46 ---- ありがとうございました。すいませんが半平太様もう一つ教えて頂けないでしょうか?リストボックスで選択List(i)の1が選択されたらA1 に〇を 3が選択されたらA3に 〇 5が選択されたらA5に 〇入力したいのです教えたください。選択されたら〇を入力するにはどう書けばいいのでしょうか? (マサオ) 2020/09/11(金) 20:27 ---- >リスト(i + 1, 1) = .List(i) ↓ リスト(i + 1, 1) = "○" (半平太) 2020/09/11(金) 21:01 ---- 半平太様さんありがとうございました。 (マサオ) 2020/09/11(金) 23:31 ...
-
https://www.excel.studio-kazu.jp/wiki/kazuwiki/202009/20200911184145.txt
- [detail]
- similar
PREV
NEXT
Powered by
Hyper Estraier 1.4.13, with 98587 documents and 615713 words.
訪問者:
