How can I put the things i select in my listbox in the sheets in one cell?

时间:2017-10-24 14:42:26

标签: excel vba excel-vba listbox

Private Sub ListBox1_Click()
 Dim WS_Count As Integer
  Dim I As Integer ' Set WS_Count equal to the number of worksheets in the active workbook.
  WS_Count = ActiveWorkbook.Worksheets.Count
  ' Begin the loop.
  For I = 1 To WS_Count
    Sheets(I).Select
    ' Insert your code here.
    Cells(2, 2).Value = ListBox1.Value

  Next I
  AcitveWorkbook.Worksheets.Cells().Value
End Sub

How can I put the things i select in my listbox in the sheets in one cell, for example cell B2, and when I change the selection for example ceo instead of cro that the cell is changing again? thx

0 个答案:

没有答案