+ Reply to Thread
Results 1 to 18 of 18

Text box question

  1. #1
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Text box question

    is there a way with VBA to pull the information from all the text boxes on a spreadsheet?

  2. #2
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Text box question

    This is a popular topic; there are a few threads needing this so I looked again and now have the generic code needed.
    For your problem:
    Please Login or Register  to view this content.
    * how you collect is up to you. This line just concatenates; at the least you would want a separator (space, vbLF etc)
    Last edited by brynbaker; 10-26-2012 at 01:55 PM.

  3. #3
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Text box question

    Thanks I will see if I can get it to work.

  4. #4
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Text box question

    Do come back if I can help further.

  5. #5
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Text box question

    OK I seem to be having issues with this. I hit this part then it goes right to end sub. I put a text box in my active sheet so I'm not sure what I'm doing wrong.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Text box question

    I looking at xl20023 at the moment so can't check. Most OLE object in xl2010 have a non-OLE equivalent. Probably that's what you are using. Hence empty OLEobjects collection.
    I cannot here work out the equivalent; it will be similar but use another collection. I'll try again when I can (tomorrow morning?)

  7. #7
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Text box question

    Cool thank you for your help.

  8. #8
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Text box question

    Your answer is here already in the forum:
    http://www.excelforum.com/excel-prog...ollection.html

    Shoulders of tall men.

  9. #9
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Text box question

    I'm sorry but I dont think thats what I'm looking for. That code deals with Lables

  10. #10
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Text box question

    From the research I did the code you provided should work. But its not seeing the textboxes on the spreadsheet. These are text boxes created through Excel by employees to add coments. I dont know if that makes a differance. Any help would be apreciated.

  11. #11
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Text box question

    Exccel has a habit of naming things misleadingly. You very often find out better by recording some simple action than by reading the formal 'help'. To aid in providing the answer i installed a 'textbox' then edited it. Excel called it a 'label'. So I googled for VBA label code and found the code I referred you to. i modified it for my test and it worked.

  12. #12
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Text box question

    Of course user-added boxes present a different issue; they can choose whether to use the OLE or the other type of box. And if you want to collect just yours not theirs you have an identification problem However yo can change thenames to something more helpful than 'Textbox1' , e.g.'Collect$1' and the macro can test for that.

  13. #13
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Text box question

    ok here is a copy of my spreadsheet. so you can see what I'm talking about.
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Text box question

    Hmm thank you and yes... , but I can't see any text boxes on the sheet.

  15. #15
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Text box question

    Sorry about that hit the plus at the top of the sheet it will expand out the rest of the sheet and you will see it.

  16. #16
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Text box question

    Unfortunately when I try to open that on this PC, I get
    Content Does Not Match Content Type
    The transferred file:
    "http://www.excelforum.com/attachment.php?attachmentid=190527&d=1351687009/xl/printerSettings/printerSettings1.bin"
    has been Blocked by the Web Gateway, because the content of the file does not match the content type "application/executable" and the Web Gateway can not correct it
    I may be able to try later without a web gateway.

  17. #17
    Forum Contributor
    Join Date
    09-21-2012
    Location
    illinois
    MS-Off Ver
    Excel 2010
    Posts
    242

    Re: Text box question

    Dont worry about it. I figured it out.

  18. #18
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Text box question

    Ok. well done

+ 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