请教,在Excel VBA中如何实现数据的筛选、拷贝?谢谢
2个回答
展开全部
将Sheet1表 ,A列单元格中为Code1的所有行筛选出来,并拷贝到当前工作簿Shee2工作表
复制代码到Sheet2
Sub 筛选复制()
Dim I%
For I = 2 To Sheet1.Range("A65536").End(xlUp).Row
If Sheet1.Cells(I, "a") = "Code1" Then
N = N + 1
Sheet1.Rows(I).Copy Cells(N + 1, "a")
End If
Next
End Sub
复制代码到Sheet2
Sub 筛选复制()
Dim I%
For I = 2 To Sheet1.Range("A65536").End(xlUp).Row
If Sheet1.Cells(I, "a") = "Code1" Then
N = N + 1
Sheet1.Rows(I).Copy Cells(N + 1, "a")
End If
Next
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询