Completando o codigo passado pelo Mauro:
Sub VerificaData()
Dim MyDate As Date, MyDay As Long, sDia As Long
Dim LR As Long
Dim i As Long
Dim BD As Worksheet
MyDate = [B7]
MyDay = Day(MyDate)
Set BD = Sheets("Banco de Dados")
LR = BD.Cells(Rows.Count, 2).End(xlUp).Row
For i = 3 To LR
sDia = BD.Cells(i, 2).Value
If MyDay = sDia Then
'MsgBox "Dia Pagamento = a : " & sDia
Cells(4, 3) = BD.Cells(i, 3).Value
Cells(4, 6) = BD.Cells(i, 4).Value
Cells(9, 4) = BD.Cells(i, 10).Value
Cells(10, 4) = BD.Cells(i, 5).Value
Cells(10, 7) = BD.Cells(i, 6).Value
Cells(11, 4) = BD.Cells(i, 7).Value
Cells(12, 4) = BD.Cells(i, 8).Value
Cells(12, 7) = BD.Cells(i, 9).Value
Cells(14, 4) = BD.Cells(i, 11).Value
Cells(16, 4) = BD.Cells(i, 12).Value
Cells(18, 4) = BD.Cells(i, 13).Value
ActiveWindow.SelectedSheets.PrintOut copies:=1, _
ActivePrinter:=True, collate:=True, ignoreprintareas:=False
Else
'Exit Sub
End If
Next
'Limpa os campos da mascara
Cells(4, 3) = ""
Cells(4, 6) = ""
Cells(9, 4) = ""
Cells(10, 4) = ""
Cells(10, 7) = ""
Cells(11, 4) = ""
Cells(12, 4) = ""
Cells(12, 7) = ""
Cells(14, 4) = ""
Cells(16, 4) = ""
Cells(18, 4) = ""
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 06/02/2012 2:14 pm