JBeaucaire help me with the following code. It works great, I have 14 ranges like this on the same spreadsheet and would like to print all of them based on the result in the target cells for the range of each to print.
I currently have a macro button to print each range as you can see. Is it possible to connect these? What I have tried is cutting the End Sub and then the Dim r As Long but get errors.
Sub PrintVariedNumber_Products_1and2()
Dim r As Long
r = 43 + (Range("E7") * 44) - 44
Range("A1:M" & r).PrintOut copies:=1
End Sub
Sub PrintVariedRange_Products_3and4()
Dim r As Long
r = 43 + (Range("S7") * 44) - 44
Range("O1:AA" & r).PrintOut copies:=1
End Sub
Sub PrintVariedRange_Products_5and6()
Dim r As Long
r = 43 + (Range("AG7") * 44) - 44
Range("AC1:AO" & r).PrintOut copies:=1
End Sub
Sub PrintVariedRange_Products_7and8()
Dim r As Long
r = 43 + (Range("AU7") * 44) - 44
Range("AQ1:BC" & r).PrintOut copies:=1
End Sub
Sub PrintVariedRange_Products_9and10()
Dim r As Long
r = 43 + (Range("BI7") * 44) - 44
Range("BE1:BQ" & r).PrintOut copies:=1
End Sub
Sub PrintVariedRange_Products_11and12()
Dim r As Long
r = 43 + (Range("BW7") * 44) - 44
Range("BS1:CE" & r).PrintOut copies:=1
End Sub
Sub PrintVariedRange_Products_13and14()
Dim r As Long
r = 43 + (Range("CK7") * 44) - 44
Range("CG1:CS" & r).PrintOut copies:=1
End Sub
Sub PrintVariedRange_Products_15and16()
Dim r As Long
r = 43 + (Range("CY7") * 44) - 44
Range("CU1:DG" & r).PrintOut copies:=1
End Sub
Bookmarks