salve , vorrei integrare questo codice per far si che stampi la seconda pagina solo se B56 non è vuoto.
allego file di esempio
codice:Sub Macro1() Sheets("Foglio1").Select Range("B11:D45").Select Selection.Copy Sheets("Foglio2").Select Range(a1).Select ActiveSheet.Paste Sheets("Foglio1").Select ActiveWindow.SmallScroll Down:=3 Range("F11:H45").Select Application.CutCopyMode = False Selection.Copy Sheets("Foglio2").Select Range("A36").Select ActiveSheet.Paste ActiveWindow.SmallScroll Down:=-39 Columns("A:C").Select Application.CutCopyMode = False Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal ActiveWindow.SmallScroll Down:=-15 Sheets("Foglio1").Select Range("A46:H54").Select Sheets("Foglio2").Select Range("A1:C35").Select Selection.Copy Sheets("Foglio1").Select ActiveWindow.SmallScroll Down:=-33 Range("B11").Select ActiveSheet.Paste Sheets("Foglio2").Select ActiveWindow.SmallScroll Down:=33 Range("A36:C70").Select Application.CutCopyMode = False Selection.Copy Sheets("Foglio1").Select Range("F11").Select ActiveSheet.Paste ActiveWindow.SmallScroll Down:=-12 Range("B10").Select Sheets("Foglio1").Select Range("B11").Select End Sub Sub Macro4() Range("B11:D45").Select Selection.Copy Sheets("Foglio3").Select ActiveWindow.SmallScroll Down:=-24 Range("A1").Select ActiveSheet.Paste ActiveWindow.SmallScroll Down:=30 Sheets("Foglio1").Select Range("F11:H45").Select Application.CutCopyMode = False Selection.Copy Sheets("Foglio3").Select Range("A36").Select ActiveSheet.Paste ActiveWindow.SmallScroll Down:=-48 Columns("A:C").Select Application.CutCopyMode = False Selection.Sort Key1:=Range("B1"), Order1:=xlAscending, Key2:=Range("C1") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _ :=xlSortNormal ActiveWindow.SmallScroll Down:=-21 Range("A1:C35").Select ActiveWindow.SmallScroll Down:=9 Selection.Copy Sheets("Foglio1").Select ActiveWindow.SmallScroll Down:=-9 Range("B11").Select ActiveSheet.Paste ActiveWindow.SmallScroll Down:=0 Sheets("Foglio3").Select ActiveWindow.SmallScroll Down:=27 Range("A36:C70").Select Application.CutCopyMode = False Selection.Copy Sheets("Foglio1").Select Range("F11").Select ActiveSheet.Paste ActiveWindow.SmallScroll Down:=3 Sheets("Foglio1").Select Range("B11").Select End Sub

Rispondi quotando

