D
djlewis2
This function...
Function Range4(R1 As Integer, C1 As Integer, R2 As Integer, C2 As
Integer) As Range
Set Range4 = Range(Cells(R1, C1), Cells(R2, C2))
End Function
.... works fine through the assignment to Range4 (gets the correct
range), but hangs at the End Funciton line with
What am I doing wrong?
I've tried: adding "ActiveSheet." to everything; an auxilliary Range
variable; searching this group.
Thanks. --David.
PS: Anybody know a better way to construct a simple rectangular range
using numeric arguments rather than string addresses. But I'd still
like to know why this function fails. It fails even if I assign a very
simple range to Range4, like ActiveCell.
Function Range4(R1 As Integer, C1 As Integer, R2 As Integer, C2 As
Integer) As Range
Set Range4 = Range(Cells(R1, C1), Cells(R2, C2))
End Function
.... works fine through the assignment to Range4 (gets the correct
range), but hangs at the End Funciton line with
Run-time error '91':
Object variable or With block variable not set
What am I doing wrong?
I've tried: adding "ActiveSheet." to everything; an auxilliary Range
variable; searching this group.
Thanks. --David.
PS: Anybody know a better way to construct a simple rectangular range
using numeric arguments rather than string addresses. But I'd still
like to know why this function fails. It fails even if I assign a very
simple range to Range4, like ActiveCell.