Moderatori: Anthony47, Flash30005
Sub MacroStampa()
'vedi http://www.pc-facile.com/forum/viewtopic.php?f=26&t=109252&p=641245#p641245
Dim StarDat As Long, C As Range, DatIn As Worksheet, I As Long
Dim myC As Long, myPr As Long
'
StarDat = Application.InputBox("Data iniziale da Stampare?", "Scegli Data", , , , , , 1)
'
Set DatIn = Sheets("Foglio1") '<<< Il foglio con i dati da stampare
'scegli printer:
SelPrint = Application.Dialogs(xlDialogPrinterSetup).Show
If SelPrint = False Then
MsgBox "Stampa Cancellata"
Exit Sub
End If
DatIn.Select
'Impostazioni di printer:
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = ""
Application.PrintCommunication = False
'IMPOSTA O MODIFICA EVENTUALI PARAMETRI DI STAMPA:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.7)
.RightMargin = Application.InchesToPoints(0.7)
.TopMargin = Application.InchesToPoints(0.75)
.BottomMargin = Application.InchesToPoints(0.75)
.HeaderMargin = Application.InchesToPoints(0.3)
.FooterMargin = Application.InchesToPoints(0.3)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
ActiveSheet.PageSetup.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
'Stampa N copie di ogni "pagina":
With Range("A:A,J:J")
For I = 0 To 9
Set C = .Find(CDate(StarDat + I), LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address
Do
C.Resize(40, 9).Select
myC = 1 '<<< impostare a 10, dopo i test
Selection.PrintOut Copies:=myC, Collate:=True ', IgnorePrintAreas:=False
myPr = myPr + 1
C.Select
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> firstAddress
End If
Next I
End With
MsgBox ("Stampate in tutto " & myPr & " pagine, in " & myC & " copie")
End Sub
Torna a Applicazioni Office Windows
Macro copia dati colonne non contigue su un altro file excel Autore: systemcrack |
Forum: Applicazioni Office Windows Risposte: 5 |
"Spegnere" il riconoscimento data. Autore: aggittoriu |
Forum: Applicazioni Office Windows Risposte: 2 |
Excel: formula automatica per evidenziare prodotto scaduto Autore: gamma_ray |
Forum: Applicazioni Office Windows Risposte: 3 |
Visitano il forum: Nessuno e 14 ospiti