Boa tarde!!!
Veja se te juda..
Sub CopyData()
Dim shREPORT As Worksheet
Dim shSOURCE As Worksheet
Dim strNAME(2) As String
Dim i As Long
Dim r As Long
Dim n As Long
Dim b As Byte
Const dDate As Date = "12 April 2012"
strNAME(0) = "Fevereiro"
strNAME(1) = "Março"
strNAME(2) = "Abril"
Set shREPORT = ThisWorkbook.Worksheets("Relatório")
r = 11
For b = 0 To 2
Set shSOURCE = ThisWorkbook.Worksheets(strNAME(b))
With shSOURCE
n = .Cells.SpecialCells(xlCellTypeLastCell).Row
For i = 2 To n
If b = 2 And IsDate(.Cells(i, 2)) Then
If CDate(.Cells(i, 2)) <= dDate And .Cells(i, 2) <> "" Then
.Rows(i).Copy Destination:=shREPORT.Rows(r)
r = r + 1
End If
ElseIf .Cells(i, 1) <> "" Then
.Rows(i).Copy Destination:=shREPORT.Rows(r)
r = r + 1
End If
Next
End With
Next
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 14/02/2012 11:26 am