我想知道为什么我得到这个问题。下标超出范围
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