+ Reply to Thread
Results 1 to 5 of 5

use VBA to put text into a text box...

  1. #1
    Registered User
    Join Date
    10-15-2008
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    93

    use VBA to put text into a text box...

    Hi there

    is there a way to use VBA to insert text into text box? I don't believe it is possible to put a formula into a text box (I have posted a question on the Excel general forum to check this), so my next thought is: can I use VBA to insert the values I want instead?

    Basically, I have a text box which I want to display certain text based on certain criteria.

    Thanks in advance
    Sunil
    Last edited by sunilmulay; 10-18-2009 at 01:16 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: use VBA to put text into a text box...

    Hello,

    You may be able to do this a few diffrent ways.
    to update a sheet textbox from VBA.
    Please Login or Register  to view this content.
    Though if you aready have a formular that will display the resutls that you want you can reference this cell in the sheet textbox.
    E.g
    (A1) = 1
    (A2) = 3
    (A3) =A1+A2.... 4
    Textbox1 formular =A3
    this would show whatever A3 is.

    Hope this helps

  3. #3
    Registered User
    Join Date
    10-15-2008
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: use VBA to put text into a text box...

    that's great news ! I didn't thing that was possible.... Thanks!

    Just so I understand the part regarding the formula...yes, I do have a formula, already calculating the result I want to put in the text box. so where do I put the line:

    Textbox1 formula =A3

    Thanks
    Sunil

  4. #4
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: use VBA to put text into a text box...

    Im asumming that this is a sheet textbox.
    Select the textbox in the formular bar it should show somehitnk like =EMBED("Forms.TextBox.1","") change this to =A3

  5. #5
    Registered User
    Join Date
    10-15-2008
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    93

    Re: use VBA to put text into a text box...

    got it!
    Thanks a bunch!
    Sunil

+ 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