Consulting

Results 1 to 6 of 6

Thread: Linking Excel Cell with Text Box

  1. #1

    Linking Excel Cell with Text Box

    Hi All

    I am trying to link multiple excel cell value to one Excel Text Box,but its not working only b4 value is coming in the textbox,..Is there is any way I put multiple excel cell value in one Textbox??
    [VBA]
    Public Sub TextBox()
    ActiveSheet.Shapes("Text Box 3").Select[VBA]
    Selection.Characters.Text = Range("B3").Value
    Selection.Characters.Text = Range("B4").Value
    Range("B1").Select
    End Sub
    [\VBA]

  2. #2
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Untested, but try this:

    [vba]Public Sub TextBox()
    ActiveSheet.Shapes("Text Box 3").Characters.Text = Range("B3").Value & Range("B4").Value
    End Sub
    [/vba]
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    If its a drawing control, use

    [vba]

    ActiveSheet.Shapes("TextBox 3").TextFrame.Characters.Text = Range("B3").Value & Range("B4").Value
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  4. #4

    Error

    Thanks A million for the reply

    But its giving an "Run Error 438 " Object doesn't support this property or method

    Is I am doing something very wrong.???

  5. #5
    Moderator VBAX Guru Ken Puls's Avatar
    Joined
    Aug 2004
    Location
    Nanaimo, BC, Canada
    Posts
    4,001
    Location
    Which example? Bob's (xld) or mine? They are different, so you should try both...
    Ken Puls, CMA - Microsoft MVP (Excel)
    I hate it when my computer does what I tell it to, and not what I want it to.

    Learn how to use our KB tags! -||- Ken's Excel Website -||- Ken's Excel Forums -||- My Blog -||- Excel Training Calendar

    This is a shameless plug for my new book "RibbonX - Customizing the Office 2007 Ribbon". Find out more about it here!

    Help keep VBAX clean! Use the 'Thread Tools' menu to mark your own threads solved!





  6. #6
    Yep I got it

    The name of the Box was not right...

    Thanks a lot

Posting Permissions

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