View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
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!