アプリ版:「スタンプのみでお礼する」機能のリリースについて

教えてください下記のプログラムにシート指定をする場合は、
どう書き換えればいいのでしょうか?

Dim x As Long, y As Long
x = 0
y = Cells(55, Columns.Count).End(xlToLeft).Offset(, 0).Column
With ListBox13
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
Cells(55, y).Offset(x) = .List(i)
x = x + 1
End If
Next i
End With

A 回答 (1件)

Dim x As Long, y As Long , ws as worksheets '★


set ws = worksheets("シート名") ' ★
x = 0
y = ws.Cells(55, Columns.Count).End(xlToLeft).Offset(, 0).Column '★
With ListBox13
For i = 0 To .ListCount - 1
If .Selected(i) = True Then
ws.Cells(55, y).Offset(x) = .List(i) '★
x = x + 1
End If
Next i
End With
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!