Set print area using variable
Posted by Ken on August 16, 2001 11:11 AM
I am trying to set a print area using a range with a fixed starting point and a variable for the end of the range. I found how to locate the last row and use it in my Sub. My variables contain the correct values after running, but I get a "type-mismatch error" when I make a reference to my variables using Cells, Columns or Rows in my Range statement.
Sub lastRow()
RealLastRow = Cells.Find("*", [A1], , , xlByRows, xlPrevious) _
.Select
firstEntry = "B:63"
lastEntry = Selection.Address
Worksheets("Payroll").Range(Cells(firstEntry), _
Cells(lastEntry)).Select
End Sub