我lrow是正確的......但我希望我Cells(I, matl.Column).Value只呼叫可見細胞。現在它呼叫所有細胞。我試過了:
Cells.SpecialCells(xlCellTypeVisible).Select(I, matl.Column).Value
那只會給我錯誤。
Lmk 如果這甚至可能!下面是我的代碼!
lrow = Workbooks(tmpwb).Worksheets(mm).AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible).Cells.Count - 1
For I = 3 To lrow
'For j = 0 To 16
session.findById("wnd[0]/usr/sub:SAPMM07M:0421/ctxtMSEG-MATNR[" & I - 3 & ",7]").Text = Cells(I, matl.Column).Value
Next I
uj5u.com熱心網友回復:
也許是這樣的:
Dim col as Range, rngVis As Range, c As Range, I As Long
Set col = Workbooks(tmpwb).Worksheets(mm).AutoFilter.Range.Columns(1)
Set rngVis = col.SpecialCells(xlCellTypeVisible)
I = 3
For Each c In rngVis.Cells
If c.Row > col.Cells(1).Row Then 'skip the header
' `I` below may need to be `c.row-3` ?
session.findById("wnd[0]/usr/sub:SAPMM07M:0421/ctxtMSEG-MATNR[" & I - 3 & ",7]").Text = _
c.EntireRow.Columns(matl.Column).Value
I = I 1
End If
Next c
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/410261.html
標籤:
上一篇:PMT公式Excel
