is there a way with VBA to pull the information from all the text boxes on a spreadsheet?
is there a way with VBA to pull the information from all the text boxes on a spreadsheet?
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:
* how you collect is up to you. This line just concatenates; at the least you would want a separator (space, vbLF etc)![]()
Please Login or Register to view this content.
Last edited by brynbaker; 10-26-2012 at 01:55 PM.
Thanks I will see if I can get it to work.
Do come back if I can help further.
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.
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?)
Cool thank you for your help.
Your answer is here already in the forum:
http://www.excelforum.com/excel-prog...ollection.html
Shoulders of tall men.
I'm sorry but I dont think thats what I'm looking for. That code deals with Lables
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.
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.
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.
ok here is a copy of my spreadsheet. so you can see what I'm talking about.
Hmm thank you and yes... , but I can't see any text boxes on the sheet.
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.
Unfortunately when I try to open that on this PC, I get
I may be able to try later without a web gateway.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
Dont worry about it. I figured it out.
Ok. well done
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks