0
我有一個表單,我想填充兩個存儲在玫瑰和客戶工作表中的數據的列表框。下面的代碼行* *是給我的麻煩。活動工作簿和選擇問題,Excel VBA
Private Sub UserForm_activate()
Application.Workbooks("xx.xlsm").Activate
ActiveWorkbook.Worksheets("Customers").Range("B2").Select
Do Until IsEmpty(ActiveCell) = True
'loop through the customer table list
lstCustomers.AddItem ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Loop
*****ActiveWorkbook.Worksheets("Roses").Range("A3").Select
Do Until IsEmpty(ActiveCell) = True
'loop through the roses table list
lstProducts.AddItem ActiveCell.Value
ActiveCell.Offset(1, 0).Select
Loop
End Sub
錯誤:範圍類的選擇方法失敗
我在做什麼錯?
[有趣的閱讀](http://stackoverflow.com/questions/10714251/excel-macro-avoiding-using-select) –