Dans ce tableau je souhaiterais affecter une macro me permettant automatiquement d'imprimer les cellules A1..AE7 quelque soit la journée, suivi de la date du jour située en colonne B103..AE111 pour l exemple de samedi.
Non, si l'on veut du VBA on affectera cette macro au bouton :
VB:
Sub Imprimer()
Dim i&
With Feuil1 'CodeName
For i = 8 To 111
If .Cells(i, 2) = Date Then
.PageSetup.PrintArea = .Cells(i, 2).Resize(19, 30).Address
.PrintPreview 'pour tester
'.PrintOut 'pour imprimer
Exit For
End If
Next
End With
End Sub
Application.ScreenUpdating = False
With ActiveSheet
.PageSetup.PrintArea = DECALER(Activité!$B$7;EQUIV(AUJOURDHUI();Activité!$B$8:$B$111;0);;19;30)
.PrintOut
.DisplayAutomaticPageBreaks = False
End With
End Sub
Non, si l'on veut du VBA on affectera cette macro au bouton :
VB:
Sub Imprimer()
Dim i&
With Feuil1 'CodeName
For i = 8 To 111
If .Cells(i, 2) = Date Then
.PageSetup.PrintArea = .Cells(i, 2).Resize(19, 30).Address
.PrintPreview 'pour tester
'.PrintOut 'pour imprimer
Exit For
End If
Next
End With
End Sub