我設法使用 rng.SpecialCells(xlCellTypeVisible) 僅修改過濾串列中的單元格,但是當我運行代碼時,它會獲取所有單元格中的所有文本(在過濾串列的范圍內),然后繼續添加這些到每個單元格。我只想為每個單元格添加一個框架,而不是從所有單元格中獲取所有文本并添加到所有單元格。這是代碼:
For Each cl In rng.SpecialCells(xlCellTypeVisible)
rng.SpecialCells(xlCellTypeVisible).Value = ActiveCell.Value & " - [Text here " & myVariable & "]"
Next cl
提前致謝
uj5u.com熱心網友回復:
試試這樣:
For Each cl In rng.SpecialCells(xlCellTypeVisible)
cl.Value = cl.Value & " - [Text here " & myVariable & "]"
Next cl
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/529986.html
標籤:擅长vba循环筛选前锋
