View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sheeny[_26_] Sheeny[_26_] is offline
external usenet poster
 
Posts: 1
Default Range is not being picked up


Please take a look at my code, I am trying to pick up the range and
print it, depending on the analysis years.

Dim area As String
Dim startrow(1) As Integer
Dim startcol(1) As Integer
Dim endrow(1) As Integer
Dim endcol(1) As Integer
Dim vern_startrow(1) As Integer
Dim vern_startcol(1) As Integer
Dim vern_endrow(1) As Integer
Dim vern_endcol(1) As Integer

fstyr = Range("FirstAll")
lstyr = Range("LastAll")

Sheets("Personal P_L").Select
For i = 1 To 15
startrow(1) = 1
startcol(1) = 20 'T
endrow(1) = 56 + 2 * (lstyr - fstyr)
endcol(1) = 46 'AT
With ActiveSheet.PageSetup
..Orientation = xlLandscape
..PaperSize = xlPaperLegal
..Range(.Cells(startrow, startcol), .Cells(endrow,
endcol)).Select
End With
Selection.PrintOut Copies:=1, Collate:=True
Next i

It gives me an error regarding my Range function...any help???

Thanks!


--
Sheeny
------------------------------------------------------------------------
Sheeny's Profile: http://www.excelforum.com/member.php...fo&userid=9082
View this thread: http://www.excelforum.com/showthread...hreadid=538967