I need to find the final column and final row numbers for a dynamic print area from worksheets in different workbooks so that I may properly define the limits for my For Next loops. The usual method of using Cells(Rows.count,1).End(xlUp).Row or Cells(1,columns.count).End(xlToLeft).Column will not work every time as some cells around the perimeter of some print areas contain text or worksheet calculations. The data I need is always contained within this print area. As a word of caution, sometimes there are empty rows within the print area but no empty columns. Additionally, the last row and last column in the print area always contain data.
As an example, using Activesheet.PageSetup.PrintArea for one spreadsheet I get a print area of $B$1:$M$103. Another print area may be $A$3:$K$80.
Using the first example print area, how can I dynamically set the final column to column M and final row to row 103?
Any help is greatly appreciated!
As an example, using Activesheet.PageSetup.PrintArea for one spreadsheet I get a print area of $B$1:$M$103. Another print area may be $A$3:$K$80.
Using the first example print area, how can I dynamically set the final column to column M and final row to row 103?
Any help is greatly appreciated!