Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default commandbar with own textfield for datetime input ??

Hi,

is it possible to create an texfield in a commandbar and use it for my own
userinput (for example time input ?)

Application.CommandBars("mycommandbar").Controls.A dd Type:=msoControlEdit

the command above is no problem i see an empty textfield in my commandbar
but how can i use it
in my excel macro ? i need it for date time input.

thanks for evry help

bye
frank


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default commandbar with own textfield for datetime input ??

Give it a caption so you can refer to it.

Sub AddEditControl()
On Error Resume Next
Application.CommandBars("mycommandbar") _
.Controls("MyEditBox").Delete
On Error GoTo 0
With Application.CommandBars("mycommandbar") _
.Controls.Add(Type:=msoControlEdit)
.Caption = "MyEditBox"
.OnAction = "EditBox_click"
End With

End Sub

Sub EditBox_Click()
With Application.CommandBars("mycommandbar") _
.Controls("MyEditBox")
MsgBox .Text
End With

End Sub

--
Regards,
Tom Ogilvy



Frank Huebener wrote in message
...
Hi,

is it possible to create an texfield in a commandbar and use it for my own
userinput (for example time input ?)

Application.CommandBars("mycommandbar").Controls.A dd Type:=msoControlEdit

the command above is no problem i see an empty textfield in my commandbar
but how can i use it
in my excel macro ? i need it for date time input.

thanks for evry help

bye
frank




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default commandbar with own textfield for datetime input ??

Frank,

It's similar to other textboxes. Assuming you have set the Onaction property
of your control, in that macro use something like


MsgBox CommandBars.ActionControl.Text


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Frank Huebener" wrote in message
...
Hi,

is it possible to create an texfield in a commandbar and use it for my own
userinput (for example time input ?)

Application.CommandBars("mycommandbar").Controls.A dd Type:=msoControlEdit

the command above is no problem i see an empty textfield in my commandbar
but how can i use it
in my excel macro ? i need it for date time input.

thanks for evry help

bye
frank




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
Datetime CSV format kh[_2_] Excel Discussion (Misc queries) 1 November 13th 08 09:08 AM
Using Excel as a database and textfield C Tate[_2_] Excel Discussion (Misc queries) 13 March 12th 08 01:13 PM
Date or datetime Dkso Excel Programming 1 December 2nd 03 08:25 PM
formatting a TextField as DD-MMM-YY format Tom Ogilvy Excel Programming 1 September 14th 03 06:00 PM
datetime in query Ling[_2_] Excel Programming 1 August 8th 03 05:08 PM


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

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

About Us

"It's about Microsoft Excel"