Imprimer avec macro

29/05-2006 à 09:21bonjours a tous


voici une macro que je viens de monte
mon probleme et que je suis sur une feuille nome divers
et que je veux imprime une feuille nome base sans que celle ci apparaisse

ma macro imprime bien mais fait apparaitre la feuille nome base

Sub ImprimeBASE()

'Msg = "Voulez-vous vraiment imprimer le rapport ?"
Style = vbYesNo + vbCritical + vbDefaultButton1
Title = "IMPRESSION DU RAPPORT"
Réponse = MsgBox(Msg, Style, Title)
If Réponse = vbYes Then
GoTo continu
Else
Exit Sub
End If
continu:
Dim MaFeuille As Object
Application.ScreenUpdating = False

'Emplacement des pages a imprimer
Set montab = Worksheets(Array(3))

'For Each MaFeuille In montab

'MaFeuille.Select
'Zone D'impression

ActiveSheet.PageSetup.PrintArea = "$a$1:$E$26"
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Next



si vous avait des idees merci par avance
aiglon74


----------
aiglon74



  • ...
09/01 à 09:18Bonjour, voici un code qui pourrait t'aider

Sub Imprimer()
'
' Imprimer Macro
'
'
Dim Plage As Range
On Error Resume Next
Set Plage = Application.InputBox('A l'aide de la sourie', 'Sélectionnez la zone à imprimer', Type:=8)
On Error GoTo 0
If Plage Is Nothing Then Exit Sub
Application.Goto Plage
If MsgBox('Voulez-vous imprimer la zone sélectionnée ?', vbYesNo) = vbYes Then
With ActiveSheet.PageSetup
.LeftHeader = ''
.CenterHeader = '&''Arial,Gras''[u]&20VOITURE 1[/u]'
.RightHeader = ''
.LeftFooter = ''
.CenterFooter = '&D'
.RightFooter = '&T'
.LeftMargin = Application.InchesToPoints(0.31496062992126)
.RightMargin = Application.InchesToPoints(0.31496062992126)
.TopMargin = Application.InchesToPoints(0.984251968503937)
.BottomMargin = Application.InchesToPoints(0.984251968503937)
.HeaderMargin = Application.InchesToPoints(0.511811023622047)
.FooterMargin = Application.InchesToPoints(0.511811023622047)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
End With
ActiveSheet.PageSetup.PrintArea = Plage.Address
ActiveSheet.PrintOut preview:=True
End If

End Sub

Le post anonyme est désactivé.
Merci de vous identifier

« Forum technique (liste des messages)2 enregistrements / page 1/1

À la Une de MemoClic

Le saviez vous ? Vous pouvez installer cette bannière ↑ gratuitement sur votre site !