I currently have a series of command buttons that initiate the printing of print areas within a single worksheet.
Many of the print areas have large numbers of rows which are reserved for possible data to be inserted.
All bar one of the print areas are to be set at one page wide.
The length of the print will be data dependant based on the length of the wage assessment period and the industrial instrument being used.
The columns are static.
I am hoping that there is a way to have excel automatically set the print area by recognising if there is any data in the first row of the first column of the print area.
If there is no data in the cell then the print area finished at the previous row.
The current code that i am having problems with is
Dim i As Integer
While Cells(i, 0) > "" 'while will loop until condition is met..
i = i + 1
Wend 'wend is while end, end of loop everything between while and wend is executed
CurPrtArea = ActiveSheet.PageSetup.Prin
If Range("linkcellfromCBox") = True Then
myPrtArea = "B101:D" & i
.PageSetup.PrintArea = myPrtArea
.FitToPagesWide = 1
.FitToPagesTall = 1
I have attached a file that I have been using.
The print area is B101:d131
Would appreciate some help in solving this issue.