我想看看为什么我会遇到这个问题。
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