0
我有一张纸需要根据某些条件进行过滤,然后将第一列值/和列AT复制到另一张纸上。 第一张(Sheet1)包含多行(但我们只需要利用A和AT列) 因此,如果AT栏包含“N/A”或空白值,则需要将列A和AT值复制到Sheet2中。 我编写VBA代码如下,并停留在过滤中YDest床单,我需要过滤数据并投入另一片上YdestVBA在条件下过滤和复制数据
“缺少信息”Private Sub Grab_Click()
Dim xSource As Workbook
Dim yDest As Workbook
'## Open both workbooks first:
Set xSource = Workbooks.Open("Vendor Dispatch new.xlsx")
Set yDest = Workbooks.Open("Vendor DisPatch Standard.xlsm")
With xSource.Sheets("Vendor Dispatch new").UsedRange
'Now, paste to y worksheet:
yDest.Sheets("Vendor Dispatch new").Range("A2").Resize(_
.Rows.Count, .Columns.Count) = .Value
yDest.Sheets("Vendor Dispatch new").Range("A2").WrapText = True
End With
yDest.Sheets("Vendor Dispatch new").Rows("2:4").Delete
'y.Sheets("Vendor Dispatch new").Range("1:1").EntireRow.Interior.Color = 1280
'Filter Data with copy into MissingInfoSheet
xSource.Close
yDest.Save
yDest.Close
End Sub
而你的问题是?你能添加一个例子吗? – AntiDrondert