View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Howard31 Howard31 is offline
external usenet poster
 
Posts: 100
Default Public Range Constant - how do I?

I think the best way to deal with it, is by using Tim Zych method (One of
your respondents) - Set the range in self contained Sub Precedure, like this
you can call it from the Workbook_Open precedure and from anywhere in the
code you want, or just execute it anytime VB goes into break mode.
I know this isn't perfect, its the best I can think of and I use this method
myself when developing.
--
A. Ch. Eirinberg


"slarbie" wrote:

Thanks again, I was just setting about to figure out why it had stopped
working. Hmmm. I'll have to figure out how I want to deal with that... Is
it preventable if I have sufficiently robust error handling in the
procedures, so break mode doesn't happen?

"Howard31" wrote:

Keep in mind that if in any time after setting the range object, the VB goes
into Break mode, the range object will become disassociated from "MyRange",
that means it will become an empty range variable = Nothing and you'll have
to reset it to "MyRange"
--
A. Ch. Eirinberg


"slarbie" wrote:

In all the modules/procedures of my project, I'd like to be able to refer to
a specific named range as a constant. I imagined this:

Public const MyRange as Range = Range("MyRange")

at the top of a module, but it doesn't work. Can someone help with the
right way to do what I'm trying to get at here? Thanks!