我正在尝试从一个电子表格中复制过滤后的数据并使用宏将其粘贴到另一个电子表格中,但是在代码运行时我收到错误。我所拥有的如下:
Sub Unmet_Projects()
Dim x As Workbook
Dim y As Workbook
Dim ws As Worksheet
Dim sh As Worksheet
Dim rng As Range
Set x = ThisWorkbook
Set y = Workbooks.Open("C:\Users\turnbull\Documents\Global Unmet Demand\1- extract-Unmet projects.xls")
Set ws = x.Sheets("Unmet Projects")
Set sh = y.Sheets("Sheet1")
Set rng = sh.Range("A1:CA100").Offset(1, 0).SpecialCells(xlCellTypeVisible).Copy
x.Sheets("Unmet Projects").Range("L3").PasteSpecial xlValues
End Sub
非常感谢任何帮助。
谢谢