Sub 圓角矩形1_Click()
i = 0
x = 0
b = "20%"
a = "='C:\Users\Show\Desktop\PLV auto report\"
For j = 1 To 300
Cells(1, 1) = a & "[" & b & ".xls]sheet1'!$A$" & j
If InStr(Cells(1, 1), "MANAGER") Then
Cells(1, 2 + i) = a & "[" & b & ".xls]sheet1'!$B$" & j
i = i + 1
End If
If InStr(Cells(1, 1), "DISK") Then
Cells(2 + x, 1 + i) = a & "[" & b & ".xls]sheet1'!$G$" & j
x = x + 1
End If
If InStr(Cells(1, 1), "MANAGER") Then
x = 0
ElseIf InStr(Cells(1, 1), "'End Test") Then
Exit For
End If
Next j
For y = 0 To 3
For x = 0 To 3
If InStr(Cells(1, 2 + y), (x + 1)) Then
Cells(9, 2 + x) = Cells(1, 2 + y)
For i = 0 To 5
Cells(10 + i, 2 + x) = Cells(2 + i, 2 + y)
Next i
End If
Next x
Next y
End Sub作者: luhpro 時間: 2016-4-16 02:06
回復 1#skyrubys
Cells(1, 1) = a & "[" & b & ".xls]sheet1'!$A$" & j
改成
Cells(1, 1) = a & "[" & b & ".xls]20%'!$A$" & j
或
Cells(1, 1) = a & "[" & b & ".xls]sheets(1)'!$A$" & j