Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有什么聪明的方法可以将命名范围中的粘贴值从一张纸复制到另一张纸,不包括隐藏行?
假设您有一个命名范围,MyRange那么您可以使用以下方法仅将可见单元格复制到另一个工作表:
MyRange
Sub CopyNamedRange() Range("MyRange").SpecialCells(xlCellTypeVisible).Copy Destination:=Worksheets("Sheet2").Range("A1") End Sub