我想知道爲什麼我得到這個問題。下標超出範圍
Private Sub test()
Dim Row As Integer
For Row = 1 To 100
'Loop through SummaryRange and ignore blanks but get document type'
Dim documentTypes As String
Dim myDocument As String, Column As Integer
Column = 2
'First get range from Summary'
Sheets("Sheet1").Active
If ActiveSheet.Cells(Row, Column).Value <> "" Then documentTypes = documentTypes + "," + ActiveSheet.Cells(Row, Column).Value
Sheets("Sheet12").Active
ActiveSheet.Range("B17").Value = documentTypes
Next Row
End Sub
我通過一系列努力環在不同的工作表,然後讓值,然後將它們連接起來成一個字符串,並輸出字符串。
編輯:
刪除SummaryRange,擺脫出一系列問題,但帶來了一個Object doesn't support this property or method
VBA的哪行產生錯誤? 'SummaryRange.Range(「Row:Column」)。Value對我來說看起來並不合適,您應該實際指定Row和Column的值。 – mellamokb 2012-04-03 23:02:51
行列本質上,我和j,我編輯它忽略SummaryRange不應該那樣。由於我得到的更改: – Anicho 2012-04-03 23:11:51
對象不支持此方法或屬性 – Anicho 2012-04-03 23:12:58