Textbox in a toolbar

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to get a textbox onto a toolbar instead of a button ?
I'd like to use it as the criteria for a search. I could open a separate
form for it, that's not a problem, but I'd like to have it immediately
available at all times. I'll put buttons next to it for "search" (which will
probably just apply a filter) and "cancel".
 
Hi Joel,
That's for putting the textbox somewhere on a worksheet but not in a toolbar
that I can use on more than one sheet.
Or am I wrong ?
 
Is there any way to get a textbox onto a toolbar instead of a button ?
I'd like to use it as the criteria for a search. I could open a separate
form for it, that's not a problem, but I'd like to have it immediately
available at all times. I'll put buttons next to it for "search" (which will
probably just apply a filter) and "cancel".

You should be able to customise a toolbar under VBA and add the
textbox.

Try this:

Sub MakeBar()
Dim customBar As CommandBar
Dim newButton As CommandBarButton
Dim newEditbtn As CommandBarComboBox
Set customBar = CommandBars.Add("Custom")
Set newEditbtn = customBar.Controls.Add(msoControlEdit)
Set newButton = customBar.Controls.Add(Type:=msoControlButton)
With newButton
.FaceId = 2
.OnAction = "MySub"
End With
customBar.Visible = True
End Sub

Cheers
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top