Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912

    Unanswered: Reference Label on Worksheet

    Hi

    I have a label from the Controls Toolbox on a worksheet. I would like to set a programmatic reference to it. How would I do so please?

    e.g.
    Code:
    Dim l As MSForms.Label
    
    Set l = ActiveSheet.Shapes("LabelName")
    This fails of course - how can I get an early bound reference please?

    Thanks
    Testimonial:
    pootle flump
    ur codings are working excelent.

  2. #2
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    511
    For ActiveX objects, something like this should do the trick:
    Code:
    Sub foo()
        Dim lbl As MSForms.Label
        
        Set lbl = Sheet1.OLEObjects("Label1").Object
        
        'etc...
        
    End Sub
    Hope that helps...

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Nnnng! So close (one attempt was just like that but I missed the .Object bit).

    Thank you very much
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •