PC Review


Reply
Thread Tools Rate Thread

How can I refference then search text in a worksheet text box

 
 
jseven
Guest
Posts: n/a
 
      3rd Nov 2007
I have a workbook which contains multiple pages and on each page is a
"notes" section that is simply an Excel text box (created from the
drawing toolbar) and I would like to write a routine that can
refference the text inside of the box. Is there a way to do this?

Let's say its name is "Text Box 1"

I thought there would be something like TextBox1.value, Shapes("Text
Box 1").text etc to refference it, but I can't figure it out. If you
could help me figure out a way to pull the text in the text box into a
variable or refference it somehow I think I'd have it from there.

Thanks so much,
Jamie

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmF5?=
Guest
Posts: n/a
 
      3rd Nov 2007
Hi Jamie -

Here's a starting point:

Sub jamie()
'Note that you have to activate the worksheet that contains the textbox
'and then select the text box before you can reference its text... this is a
'requirement of the Characters.Text (Method.Property) combination for some
'reason.

Dim boxText As String

Worksheets("Sheet1").Activate
Worksheets("Sheet1").Shapes("Text Box 1").Select ' or .Shapes(1).Select
boxText = Selection.Characters.Text
MsgBox boxText

End Sub
---
Jay

"jseven" wrote:

> I have a workbook which contains multiple pages and on each page is a
> "notes" section that is simply an Excel text box (created from the
> drawing toolbar) and I would like to write a routine that can
> refference the text inside of the box. Is there a way to do this?
>
> Let's say its name is "Text Box 1"
>
> I thought there would be something like TextBox1.value, Shapes("Text
> Box 1").text etc to refference it, but I can't figure it out. If you
> could help me figure out a way to pull the text in the text box into a
> variable or refference it somehow I think I'd have it from there.
>
> Thanks so much,
> Jamie
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: VBA Search worksheet, find text, change color of row Gord Microsoft Excel Programming 1 22nd Jul 2011 11:46 PM
How to search a worksheet for text-value matches? AdanaDarke Microsoft Excel Worksheet Functions 2 3rd Jan 2008 06:44 PM
Refference Unbound Text Box hmiller@hartford.edu Microsoft Excel Programming 1 30th Oct 2005 07:20 PM
Find / Search for text boxes in a worksheet John Ellis Microsoft Excel Programming 18 25th Oct 2004 04:03 PM
How to search for a text string in one worksheet and have it return the whole row Sheik Yourbootey Microsoft Excel Worksheet Functions 6 23rd Sep 2004 08:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:42 AM.