Search:

Type: Posts; User: Rudi; Keyword(s):

Search: Search took 0.10 seconds.

  1. Replies
    11
    Views
    13,356

    Re: Can you Const an Object? (Excel VBA)

    Yes...that was my error!

    Thanks for the info Jan and Stuart. I'll look into your suggestions when I get chance!
    Tx
  2. Replies
    11
    Views
    13,356

    Re: Can you Const an Object? (Excel VBA)

    Alan, you may be on to something.

    Something like this: Public myVal as variant in the global declaration area
    and
    Private Sub Workbook_Open()
    myVar = Range("B2").Value
    End Sub

    Sub Test()...
  3. Replies
    11
    Views
    13,356

    Re: Can you Const an Object? (Excel VBA)

    Hans, tx I understand what you are saying. Your answer does give a method that can work...but is there any other way to do this? I'm would like to know if I can preserve a value that comes from a...
  4. Replies
    11
    Views
    13,356

    Can you Const an Object? (Excel VBA)

    Hi,
    Can I store an object (Range) as a Const? I get a compile error with "Const myR = Range("B2").Value"
    For instance, I want to store the value in cell B2 and preserve it for use in other subs in...
Results 1 to 4 of 4