Passing a range into a VBA function

F

Floyd

All:

I am attempting to pass a cell such as $C10 into a function. Inside
the function, I have the following code:

Dim Rng1 as Range
Set Rng1 = Range("$C10")

This code segment works. Now, if I attempt to pass a named cell into
the code, it compiles but gives the following error message when
"Watched". <Expression not defined in context> Type = Empty

Dim Rng1 as Range
Set Rng1 = Range(NamedCell)

Any suggestions?

Thanks in advance.

Cheers.
 
F

Floyd

Mr. May,

I apologize. The range itself is not names. It is being passed as
reference with the name, NamedCell. For example, Function
Testing(NamedCell as range)

Thanks so much for your assistance.

Cheers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top