Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Userform combobox dropdown question

Hi TP

Not exactly sure what your aiming for here but if you don't want the
user to be able to change the value of the combobox you could just set
it to be locked use code something like

ComboBox1.List = Array("", "blah", "BLah", "BLAH")
ComboBox1.ListIndex = 3
ComboBox1.Locked = True

will lock the combobox to show the value BLAH

hope this helps you out

S



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Userform combobox dropdown question


"Incidental" wrote in message
oups.com...
Hi TP

Not exactly sure what your aiming for here but if you don't want the
user to be able to change the value

Thanks for trying to help. All I'm really trying to do is to get the
combobox to retract after a selection is made. At the moment you have to
click the selection twice - onced to select and then again to shrink the
list down to sized again. Then you have to click something else on the form
to deselect the combobox in order for any of the other buttonsit to work.
Not very user friendly...


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Userform combobox dropdown question

Hi there

It is early in the morning here and I have read your post a few times
but I still don't understand why don't you post a bit of you code and
some descriptions of what controls are called and I will have a look
see what I can figure out, can't promise I will be able to do anything
but I will give it a go for sure.

S



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Userform combobox dropdown question

Many thanks. I'm most grateful.

This is in a userform combobox with a media player object. The combobox
selects a phrase (eg "start of movie scene two") linked to a number which
tells the media player where to start playing the video from. But the list
then sits in front of the video unless you click on the combobox list again
to get rid of it. And then you have to click on it a third time to deselect
it completely and allow access to other shapes and media player controls. I
want to get rid of the need for that second and third click.

Private Sub Combobox1_change()


With Me.ComboBox1
If .ListIndex < 0 Then
Beep
Else
'pick out the second column
myVar = .List(.ListIndex, 1)

'show mediaplayer at the correct position
MP.CurrentPosition = myVar


End If
End With

' here follow a few failed attempts to get the combobox to retract
again after the previous command....

' DropDowns("Drop Down 1").Select
'Selection.Delete

' wih Me.DropDowns("drop down 1")
' .Visible = msoFalse
' End With

' With Me.Shapes("Drop Down 1")
' Selection.Delete
'End With

'ComboBox1.DropDown = false


End Sub

and

Private Sub UserForm_Initialize()

Dim myRng As Range


With ThisWorkbook.Worksheets("sheet2")
'defines the contents of the listbox in ff and a linked value in fg
Set myRng = .Range("ff1:fg" & .Cells(.Rows.Count,
"ff").End(xlUp).Row)
End With

With Me.ComboBox1
.ColumnCount = myRng.Columns.Count
.List = myRng.Value
.ColumnWidths = "33;0"
End With


"Incidental" wrote in message
oups.com...
Hi there

It is early in the morning here and I have read your post a few times
but I still don't understand why don't you post a bit of you code and
some descriptions of what controls are called and I will have a look
see what I can figure out, can't promise I will be able to do anything
but I will give it a go for sure.

S




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Userform combobox dropdown question


"Susan" wrote in message
oups.com...
ummmmmmm....... i have bad news.
from fairly thorough searching of the newsgroup regarding excel losing
focus, i found (when i was trying to do it myself), that basically you
can't. once excel loses focus, vba won't run. vba isn't running
windows. so vba can't return focus from another application (in
windows) to excel (in windows).
personally, i was trying to have excel open windows media player &
start a sound file, then return to excel - you said "a" media player
so i don't know if it's the same one or not, but i couldn't see how to
do it (or see how anybody ELSE did it).


Unles I'm misunderstanding you, I'm not sure we're talking about the same
thing. This media player IS a VBA object which runs, responds to, and is
totally controlled by Excel and VBA (perhaps that approach would solve your
problem?)

What I need to do is switch the focus from the combobox to the media
player.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Userform combobox dropdown question

excel has a media player?????? where??????????

i'd love to understand what you're talking about, cuz perhaps i could
also use it, as you said.

if you search the newsgroup for "excel play sounds", you'll see
there's quite a few posts on this, which i haven't been able to get to
work (including the stupid BEEP command). :) what type of media
are you playing? video, i think you said.
well, maybe somebody else knows what you are talking about, because
obviously i don't. ha ha.
i'll keep watching, tho.
susan



On May 24, 5:25 pm, "teepee" wrote:
"Susan" wrote in message

oups.com...
ummmmmmm....... i have bad news.
from fairly thorough searching of the newsgroup regarding excel losing
focus, i found (when i was trying to do it myself), that basically you
can't. once excel loses focus, vba won't run. vba isn't running
windows. so vba can't return focus from another application (in
windows) to excel (in windows).
personally, i was trying to have excel open windows media player &
start a sound file, then return to excel - you said "a" media player
so i don't know if it's the same one or not, but i couldn't see how to
do it (or see how anybody ELSE did it).

Unles I'm misunderstanding you, I'm not sure we're talking about the same
thing. This media player IS a VBA object which runs, responds to, and is
totally controlled by Excel and VBA (perhaps that approach would solve your
problem?)

What I need to do is switch the focus from the combobox to the media
player.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Userform combobox dropdown question


"Susan" wrote in message
oups.com...
excel has a media player?????? where??????????

i'd love to understand what you're talking about, cuz perhaps i could
also use it, as you said.

Create a userform in VBA editor
Select toolbox
Right click toolbox
Select additional controls
Tick windows media player
Go back to toolbox and drag & drop the WMP icon into the userform

You now have a VBA programable Windows Media Player


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default Userform combobox dropdown question

oooooohhh!
& i assume it works, except for the combobox issue.......
thanks!
susan


Create a userform in VBA editor
Select toolbox
Right click toolbox
Select additional controls
Tick windows media player
Go back to toolbox and drag & drop the WMP icon into the userform

You now have a VBA programable Windows Media Player



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
Userform combobox dropdown question Incidental Excel Programming 0 May 23rd 07 01:32 PM
Userform combobox dropdown question teepee Excel Programming 0 May 23rd 07 11:20 AM
Yet another userform combobox question teepee Excel Programming 4 May 17th 07 10:03 AM
Userform combobox question teepee Excel Discussion (Misc queries) 2 May 17th 07 09:22 AM
Userform combobox question teepee Excel Discussion (Misc queries) 20 May 16th 07 09:42 AM


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

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

About Us

"It's about Microsoft Excel"