ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to return a range (https://www.excelbanter.com/excel-programming/433228-how-return-range.html)

NDBC

how to return a range
 
I need to return a range to send it to a function. This is what I am using

Set ranger = Range(Cells(TRow, 14), Cells(TRow, TCol + 3)).Address

It doesn't seem to work. All the variables are correct in debugger but the
ranger (dim as range) is "nothing".

Thanks again



Rick Rothstein

how to return a range
 
Try removing the .Address property call from the end of the Range (Address
returns a String value... you need an object to be assigned to the ranger
range).

--
Rick (MVP - Excel)


"NDBC" wrote in message
...
I need to return a range to send it to a function. This is what I am using

Set ranger = Range(Cells(TRow, 14), Cells(TRow, TCol + 3)).Address

It doesn't seem to work. All the variables are correct in debugger but the
ranger (dim as range) is "nothing".

Thanks again




Jacob Skaria

how to return a range
 
Dim myRange as Range
Set myRange = Range(Cells(),Cells())


"NDBC" wrote:

I need to return a range to send it to a function. This is what I am using

Set ranger = Range(Cells(TRow, 14), Cells(TRow, TCol + 3)).Address

It doesn't seem to work. All the variables are correct in debugger but the
ranger (dim as range) is "nothing".

Thanks again




All times are GMT +1. The time now is 11:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com