请参阅下面的图片,其中在列a中应用过滤器以选择项目“b”,然后在注释字段中更新“确定”。你知道如何通过宏来做到这一点吗?此外,我需要知道在打开和过滤过滤器时如何选择列中的可见单元格。
答案 0 :(得分:0)
Sub Copy_Filtered_Cells()
Set from = Application.InputBox("Select range of Cell to copy", Type:=8).SpecialCells(xlCellTypeVisible)
'Selection.SpecialCells(xlCellTypeVisible).Select
'Set from = Selection
Set too = Application.InputBox("Select range to Paste Copied Cells", Type:=8)
For Each Cell In from
Cell.Copy
For Each thing In too
If thing.EntireRow.RowHeight > 0 Then
thing.PasteSpecial
Set too = thing.Offset(1).Resize(too.Rows.Count)
Exit For
End If
Next
Next
End Sub
它可能适合你。