#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combo Box

I created a Combo box with a list of names , that when clicked, goes to
that persons worksheet. This works fine except, if you click on a name,
go to that worksheet then come back to the Combo Box, the same name is
still highlighted and when clicked, nothing happens. You have to click
on a different name for it to work.
Is there a way around this so that you can click on whatever name
appears in the box?

I have the combo box in conjunction with Option Buttons.

What I have (some of) at present is...

If cboHouse.Text = "Joe Blow" And optHouse.Value = True Then
Application.Goto Reference:=Worksheets("Sheet1").Range("A213"), _
Scroll:=True
End
End If
If cboHouse.Text = "John Smith" And optHouse.Value = True Then
Application.Goto Reference:=Worksheets("Sheet1").Range("A244"), _
Scroll:=True
End
End If

End Sub

Any help appreciated.
Cheers
Graham.


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Combo Box

Your code needs to change the combo box value to "" so
that when you return and select the same name from the
list it will initiate the Change event. This apparently
is a requirement for the Click event as well (oddly). My
read of your code is that "cboHouse" is an object variable
that refers to the combo box. Therefore, I suggest:
cboHouse.Value = ""

You might also consider exploiting the combo box's
ListIndex property to select the worksheet range instead
of using If Then code. Perhaps something like:

Cells(cboHouse.ListIndex + 50, 1).Select

Regards,
Greg


-----Original Message-----
I created a Combo box with a list of names , that when

clicked, goes to
that persons worksheet. This works fine except, if you

click on a name,
go to that worksheet then come back to the Combo Box, the

same name is
still highlighted and when clicked, nothing happens. You

have to click
on a different name for it to work.
Is there a way around this so that you can click on

whatever name
appears in the box?

I have the combo box in conjunction with Option Buttons.

What I have (some of) at present is...

If cboHouse.Text = "Joe Blow" And optHouse.Value = True

Then
Application.Goto Reference:=Worksheets("Sheet1").Range

("A213"), _
Scroll:=True
End
End If
If cboHouse.Text = "John Smith" And optHouse.Value = True

Then
Application.Goto Reference:=Worksheets("Sheet1").Range

("A244"), _
Scroll:=True
End
End If

End Sub

Any help appreciated.
Cheers
Graham.


---
Message posted from http://www.ExcelForum.com/

.

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
linking a form combo box... results from the combo box to another Trey Excel Discussion (Misc queries) 1 July 15th 07 01:58 AM
combo reference on another combo box for picking address etc. kbjin Excel Worksheet Functions 1 December 8th 06 03:29 PM
In Excel I need to set up a combo box based on another combo box. donna_ge Excel Discussion (Misc queries) 2 March 29th 06 03:26 PM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 1 February 16th 05 02:05 AM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 0 February 15th 05 07:45 PM


All times are GMT +1. The time now is 07:32 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"