ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Setting multiple ranges to print (https://www.excelbanter.com/excel-discussion-misc-queries/141128-setting-multiple-ranges-print.html)

bluegrassstateworker

Setting multiple ranges to print
 
Hi all,
I have a function that has radio boxes as a parameter selection. At
each radio box I have a macro assigned which looks similar to below
where I assign an upper row and a lower row for a range that I wish to
print. The variable was defined as Global and as a String.

Sub RadioButtonSelection_1Example()
vrow1 = 98 'both vrow1 and vrow2 defined as global and long
vrow2 = 109
End Sub

Sub printme()
vrow1 = "A" & vrow1 'the final product will be A98 in this case
vrow2 = "A" & vrow2 'the final product will be A109 in this case
If e_agency = True Then
Range("A86:A97", "&vrow1:&vrow2").Select
Selection.PrintOut Copies:=1, Collate:=True
Else
Range("&vrow1:&vrow2").Select
Selection.PrintOut Copies:=1, Collate:=True
End If
End Sub



All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com