|
-
Jul 10th, 2000, 10:14 AM
#1
Thread Starter
Junior Member
here is what i have, but i am geting an error. I need to be able to print from A101 to the G column, but only up until the las t record in that column. I mean is if the are records from a101 to A 105, i need to just print them. But, this range can change.
I have this code, but I am getting an undeclared error
Sub p()
Dim rowRng As Range, pntRng As Range
With ActiveSheet
Set rowRng = .Range("101:65536")
Set pntRng = Intersect(pntRng.Parent.UsedRange, rowRng)
.PageSetup.PrintArea = pntRng.Address
.PrintOut
Set rowRng = Nothing
Set rowRng = Nothing
End With
End Sub
-
Jul 10th, 2000, 10:25 AM
#2
Hyperactive Member
My bad, I left out init pntRng.
This be better...
Code:
Sub p()
Dim rowRng As Range, pntRng As Range
With ActiveSheet
Set rowRng = .Range("101:65536")
' Bigfoot sighting...
Set pntRng = rowRng
Set pntRng = Intersect(pntRng.Parent.UsedRange, rowRng)
.PageSetup.PrintArea = pntRng.Address
.PrintOut
Set rowRng = Nothing
Set rowRng = Nothing
End With
End Sub
[Edited by Mongo on 07-10-2000 at 11:27 AM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|