View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected] david.ritchie.au@gmail.com is offline
external usenet poster
 
Posts: 12
Default Textbox in a toolbar

On Jul 3, 11:22 pm, #DIV/0 wrote:
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".

--
David M
WinXP - Office2003 (Italian)


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