Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Find / Search for text boxes in a worksheet

Does anyone know any method for searching a workbook for text that is
contained in a text box?

The basic Find command searches only the text in cells (or formulas) it does
not search the text in the text box.

If someone could helpme that would be great


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Find / Search for text boxes in a worksheet

hi,
I don't think that is possible with build in xl features.
Regards
Frank

-----Original Message-----
Does anyone know any method for searching a workbook for

text that is
contained in a text box?

The basic Find command searches only the text in cells

(or formulas) it does
not search the text in the text box.

If someone could helpme that would be great


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find / Search for text boxes in a worksheet

What kind of textbox? From the control toolbox toolbar or from the Forms
Toolbar?

There isn't a single command for this - so are you looking for code that
loops through the textboxes?

--
Regards,
Tom Ogilvy


"John Ellis" wrote in message
...
Does anyone know any method for searching a workbook for text that is
contained in a text box?

The basic Find command searches only the text in cells (or formulas) it

does
not search the text in the text box.

If someone could helpme that would be great




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Find / Search for text boxes in a worksheet

Tom,

It is just a "normal" text box created by a user,not code generated that
contains job names or the like.

We use an excel spreadsheet for scheduling and the text boxes are useful
as they cn be clicked and dragged around as production changes.

We would like the facility to seach for a name in the etxt boxes rather
than having to search all the way through the sheet manually.

At the moment the "Find" simply searches the cell contents and ignores
the contents of the texts boxes.

The text boxes typically have something like:
SS04 - 294
Sunline
October Mailing

A macro or VB code embedded would beperfect if anyone could advise me
how to go about it ?

Thanks in advance



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find / Search for text boxes in a worksheet

There is no normal textbox. There is a textbox from the drawing toolbar (my
mistake in saying forms) and there is a textbox from the control toolbox
toolbar. As you might imagine, they are addressed differently, so it would
be important to know which.

With the worksheet active, run this code

Sub DetermineType()
msgbox "Textboxes from drawing toolbar: " & ActiveSheet.Textboxes.count
cnt = 0
for each tbox in ActiveSheet.OleObjects
if typeof tbox.object is MSForms.Textbox then
cnt = cnt + 1
end if
Next
Msgbox "Textboxes from the Control toolbox Toolbar: " & cnt
End Sub

--
Regards,
Tom Ogilvy

"John Ellis" wrote in message
...
Tom,

It is just a "normal" text box created by a user,not code generated that
contains job names or the like.

We use an excel spreadsheet for scheduling and the text boxes are useful
as they cn be clicked and dragged around as production changes.

We would like the facility to seach for a name in the etxt boxes rather
than having to search all the way through the sheet manually.

At the moment the "Find" simply searches the cell contents and ignores
the contents of the texts boxes.

The text boxes typically have something like:
SS04 - 294
Sunline
October Mailing

A macro or VB code embedded would beperfect if anyone could advise me
how to go about it ?

Thanks in advance



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Find / Search for text boxes in a worksheet

Tom,

User-defined type not defined

is the error I am getting !!

If TypeOf tbox.Object Is MSForms.TextBox Then

Debugger stops at TypeOf


I hope that this makes sense ?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find / Search for text boxes in a worksheet

The previous code ran fine for me before I posted it. However,

Put this in a general module in your workbook (in the vbe, Insert=Module).
Put it in that module.

Sub DetermineType()
Dim cnt As Long, tbox As OLEObject
MsgBox "Textboxes from drawing toolbar: " _
& ActiveSheet.TextBoxes.Count
cnt = 0
For Each tbox In ActiveSheet.OLEObjects
If TypeOf tbox.Object Is MSForms.TextBox Then
cnt = cnt + 1
End If
Next
MsgBox "Textboxes from the Control toolbox Toolbar: " & cnt
End Sub

--
Regards,
Tom Ogilvy


"John Ellis" wrote in message
...
Tom,

User-defined type not defined

is the error I am getting !!

If TypeOf tbox.Object Is MSForms.TextBox Then

Debugger stops at TypeOf


I hope that this makes sense ?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract text in middle using Mid and Find or Search Karin Excel Discussion (Misc queries) 5 January 24th 08 08:01 AM
Search, find or lookup defined text in text string zzxxcc Excel Worksheet Functions 9 September 6th 07 09:37 PM
Find and replace should work in Excel text boxes Bob@Teton Excel Discussion (Misc queries) 0 October 20th 05 01:16 PM
Search/Find in any worksheet Daniel Excel Programming 2 July 14th 04 09:09 PM
How do you search values and display them in lables/text boxes mabz[_4_] Excel Programming 0 June 29th 04 11:52 AM


All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"