Consulting

Results 1 to 2 of 2

Thread: How do I make multiple labels equal to one text box

  1. #1
    VBAX Newbie
    Joined
    May 2020
    Posts
    1
    Location

    Post How do I make multiple labels equal to one text box

    Hi Everyone,

    I am a huge newbie to coding so I hope you can help me.

    In power point 2010 I want to be able to have the words entered into a text box appear on multiple labels I have throughout my presentation.

    I have been able to do this with one label using this line of code...

    Private Sub TextBox1_Change()
    Label1.Caption = TextBox1.Text
    End Sub

    ...but cannot work out how to have multiple labels equal the text box. I have tried multiple ways including this below but I can't seem to get my head around it.

    Private Sub TextBox1_Change()
    Label1.Caption , Label2.Caption = TextBox1.Text
    End Sub

    As I said I am incredibly new to all of this so it's probably a very easy fix. I hope you can help.

    Thank you.

  2. #2
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    7,196
    Location
    Off hand, I'd say something like this

    Private Sub TextBox1_Change()
        Label1.Caption = TextBox1.Text
        Label2.Caption = TextBox1.Text
    End Sub
    
    ---------------------------------------------------------------------------------------------------------------------

    Paul

    Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Tags for this Thread

Posting Permissions

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