Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Extract text in middle using Mid and Find or Search | Excel Discussion (Misc queries) | |||
Search, find or lookup defined text in text string | Excel Worksheet Functions | |||
Find and replace should work in Excel text boxes | Excel Discussion (Misc queries) | |||
Search/Find in any worksheet | Excel Programming | |||
How do you search values and display them in lables/text boxes | Excel Programming |