+ Reply to Thread
Results 1 to 5 of 5

Writing text in a label using VBA

  1. #1
    Registered User
    Join Date
    12-16-2010
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2007
    Posts
    14

    Writing text in a label using VBA

    Hi,

    I have an userform in which the user inserts data into a textbox. The text in the label corresponding to that textbox changes accordingly to a counter. Is it possible to use VBA to change the caption in the label?

    I mean, I want the label to say "Enter the value for the bolt" & i

    thanks for your help

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Writing text in a label using VBA

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    12-16-2010
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Writing text in a label using VBA

    I already tried that. My label is called lblXcoor, from the subroutine I have a For statement and call the call the userform as frmWeldSeg.show

    Please Login or Register  to view this content.
    But it doesn't seem to work. Any ideas??

    Sorry but I'm new at the forum
    thanks for replying

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Writing text in a label using VBA

    Does it generate an error?

    What hapens when you step through the code? (See http://www.cpearson.com/excel/Debug.htm)

  5. #5
    Registered User
    Join Date
    12-16-2010
    Location
    Puerto Rico
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Writing text in a label using VBA

    Hi, shg

    I changed the For i statement to

    Please Login or Register  to view this content.
    And it seems to be working fine. It appears to have been missing the point before lblXcoor, etc.

    Thanks for your attention

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1