[Boa Tarde,
Estou com dificuldade para encontrar uma solução para o meu problema que é o seguinte:
Eu tenho em excel varias folhas de calculo e precisava de actualizar a minha macro para imprimir as folhas que são seleccionadas automaticamente, num unico ficheiro pdf,
em que ele ficasse com o nome definido numa celula.
se alguém me pudesse ajudar agradecia.
Sub Macro9()
If MsgBox(("Tem a certeza que deseja imprimir a AMOSTRA COMPLETA ?"), vbYesNo + vbQuestion, "CONFIRMAÇÃO") = vbYes Then
If Range("AB21") = ("X") Then
Sheets("baridade inertes").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB27") = ("X") Then
Sheets("fragmentabilidade").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB28") = ("X") Then
Sheets("degradabilidade").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB16") = ("X") Then
Sheets("índice lam.-alon.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB17") = ("X") Then
Sheets("L.Ang.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB14") = ("X") Then
Sheets("Mat.Org.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB13") = ("X") Then
Sheets("Teor hum.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB11") = ("X") Then
Sheets("CBR4").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("CBR3").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("CBR2").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("CBR1").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB25") = ("X") Then
Sheets("CBR Instantaneo").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB25") = ("X") Then
Sheets("Grafico CBR Ins.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB22") = ("X") Then
Sheets("Estudo T.V.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB26") = ("X") Then
Sheets("Macro").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB12") = ("X") Then
Sheets("P.Esp.solos (grãos)").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB7") = ("X") Then
If Range("AB10") = ("X") Then
If Range("AB18") = ("X") Then
Sheets("Corrc. > 19 mm").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
End If
End If
If Range("AB7") = ("X") Then
If Range("AB18") = ("X") Then
If Range("AB19") = ("X") Then
If Range("AB20") = ("X") Then
Sheets("P.Esp.(M.P.)> 19mm").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
End If
End If
End If
If Range("AB20") = ("X") Then
Sheets("P.Esp. <4,76mm").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB19") = ("X") Then
Sheets("P.Esp. >4,76mm").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB18") = ("X") Then
Sheets("P.Esp >19mm").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB10") = ("X") Then
Sheets("Proctor").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB15") = ("X") Then
Sheets("azul met.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB8") = ("X") Then
Sheets("E. Areia").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB7") = ("X") Then
Sheets("Granulometria").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB9") = ("X") Then
Sheets("Lim.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB9") = ("X") Then
If Range("AB7") = ("X") Then
Sheets("Classif.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
End If
If Range("AB6") = ("X") Then
Sheets("R. Am.").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
If Range("AB5") = ("X") Then
Sheets("Proc").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
End If
Sheets("RA").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Sheets("Menu").Select
If MsgBox(("A imprimir a Amostra Completa"), vbOKOnly + vbInformation, "INFORMAÇÃO") = vbOK Then
End If
End If
End Sub
Postado : 29/09/2012 2:47 pm