エラー '9'が表示される原因を特定できません。文字列配列を宣言した後、配列名を使ってシート名を設定したいと思います。私は間違っているの?初心者のためのループスルー文字列配列、エラー '9'
Dim wsText() As String
Dim sht As Worksheet
Dim wSum As Worksheet
Dim service As String
Dim supplier As String
Dim priceRange As String
Dim price As String
Dim Lrow As Integer, LastRow As Integer
Set sht = ThisWorkbook.Worksheets(4)
Set wSum = ThisWorkbook.Worksheets(Summary)
wsText = Array("<25K", "25K <100K", "100K <250K", "250K <500K", "500K <1M", "1M <5M", "5M <15M", "15M <30M", "30M <50M")
LastRow = sht.Cells(sht.Rows.Count, "A").End(xlUp).Row
For Each element In wsText
For i = 5 To LastRow
For j = 13 To 47
Lrow = wSum.UsedRange.Rows(wSum.UsedRange.Rows.Count).Row + 1
service = ThisWorkbook.Worksheets(element.Value).Cells(i, 1).Text
supplier = ThisWorkbook.Worksheets(element.Value).Cells(4, j).Text
priceRange = ThisWorkbook.Worksheets(element.Value).Cells(2, 1).Text
price = ThisWorkbook.Worksheets(element.Value).Cells(i, j).Text
wSum.Cells(Lrow, 1) = service
wSum.Cells(Lrow, 2) = supplier
wSum.Cells(Lrow, 3) = priceRange
wSum.Cells(Lrow, 4) = price
Next j
Next i
Next element
End Sub
++、それに私を打つ:) –
感謝トン、私の記事を削除した....いくつかの成果を.... :) – cyboashu
はどうもありがとうございました!私はコードを慎重に見ることができない、私の自己を憎む! –