Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mel Mel is offline
external usenet poster
 
Posts: 74
Default refresh combobox

hi guys,

pretty new to the programming of excel and would like to ask bout this
question.

Here's what i have done so far:

i have a two comboboxes (i.e. ComboBox A and B)
say i have a few values in ComboBoxA and when a user selects a certain
value, ComboBoxB would change it's ListFillRange according to the value
selected in ComboBoxA. However, the values in ComboBoxB would not update
itself unless i manually change the values in ComboBoxB.
anyone can help me in terms of how to refresh the ListFillRange in ComboBoxB
when a selection in ComboBoxA is changed?


my code:

Private Sub ComboBox2_Change()

If ComboBox1.Value = "A" Then
ComboBox2.ListFillRange = "AList"

Else
ComboBox2.ListFillRange = "BList"

End If

End Sub



Thanks in Advance,

Melvin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default refresh combobox

Hello Melvin

As you change the value of ComboBox A, you need to use the event code for
ComboBox 1 not ComboBox 2.

Private Sub ComboBox1_Change()

If ComboBox1.Value = "A" Then
ComboBox2.ListFillRange = "AList"
Else
ComboBox2.ListFillRange = "BList"
End If
me.Repaint
End Sub

Regards,
Per

"mEl" skrev i meddelelsen
...
hi guys,

pretty new to the programming of excel and would like to ask bout this
question.

Here's what i have done so far:

i have a two comboboxes (i.e. ComboBox A and B)
say i have a few values in ComboBoxA and when a user selects a certain
value, ComboBoxB would change it's ListFillRange according to the value
selected in ComboBoxA. However, the values in ComboBoxB would not update
itself unless i manually change the values in ComboBoxB.
anyone can help me in terms of how to refresh the ListFillRange in
ComboBoxB
when a selection in ComboBoxA is changed?


my code:

Private Sub ComboBox2_Change()

If ComboBox1.Value = "A" Then
ComboBox2.ListFillRange = "AList"

Else
ComboBox2.ListFillRange = "BList"

End If

End Sub



Thanks in Advance,

Melvin


  #3   Report Post  
Posted to microsoft.public.excel.programming
Mel Mel is offline
external usenet poster
 
Posts: 74
Default refresh combobox

Hey thanks buddy!

it worked!

Melvin

"Per Jessen" wrote:

Hello Melvin

As you change the value of ComboBox A, you need to use the event code for
ComboBox 1 not ComboBox 2.

Private Sub ComboBox1_Change()

If ComboBox1.Value = "A" Then
ComboBox2.ListFillRange = "AList"
Else
ComboBox2.ListFillRange = "BList"
End If
me.Repaint
End Sub

Regards,
Per

"mEl" skrev i meddelelsen
...
hi guys,

pretty new to the programming of excel and would like to ask bout this
question.

Here's what i have done so far:

i have a two comboboxes (i.e. ComboBox A and B)
say i have a few values in ComboBoxA and when a user selects a certain
value, ComboBoxB would change it's ListFillRange according to the value
selected in ComboBoxA. However, the values in ComboBoxB would not update
itself unless i manually change the values in ComboBoxB.
anyone can help me in terms of how to refresh the ListFillRange in
ComboBoxB
when a selection in ComboBoxA is changed?


my code:

Private Sub ComboBox2_Change()

If ComboBox1.Value = "A" Then
ComboBox2.ListFillRange = "AList"

Else
ComboBox2.ListFillRange = "BList"

End If

End Sub



Thanks in Advance,

Melvin



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
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM
auto refresh for combobox Paul Lautman Excel Programming 0 May 19th 04 04:37 PM
Refresh combobox after inserting new sheet Duke17 Excel Programming 11 April 27th 04 02:55 PM
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH Ken Roberts Excel Programming 3 September 11th 03 06:02 AM


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