Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA ComboBox

Hi All!

I have a problem with a ComboBox ListFill Range. I use this code fo
the first ComboBox:

Sheets("Start").Select
x = Application.Match(Val(ComboBox2), Range("A2:A1002"), 0)
If IsNumeric(x) Then
ComboBox3 = Range("B2:B1002").Cells(x) 'ListFillRange
End If

ComboBox3 =cells(x), column("B") = Range("B2:B1002").Cells(x)
vertical match.
This one works ok.

But:

Then i want ComboBox4 to match:
If cells(x)= ("A2") then ComboBox4= Row("2"), Columns ("L:Q"),
= ("L2:Q2") .Cells(x) = horizontal match.

I just can't make this one work.

Suggestions?

/Stromm

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default VBA ComboBox

Stronma,

Have you tried

ComboBox4 = Rows(2).Columns("L:Q").Cells(x)

or

ComboBox4 = Range("L2:Q2").Cells(x)

--

HTH

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

"Stromma " wrote in message
...
Hi All!

I have a problem with a ComboBox ListFill Range. I use this code for
the first ComboBox:

Sheets("Start").Select
x = Application.Match(Val(ComboBox2), Range("A2:A1002"), 0)
If IsNumeric(x) Then
ComboBox3 = Range("B2:B1002").Cells(x) 'ListFillRange
End If

ComboBox3 =cells(x), column("B") = Range("B2:B1002").Cells(x) =
vertical match.
This one works ok.

But:

Then i want ComboBox4 to match:
If cells(x)= ("A2") then ComboBox4= Row("2"), Columns ("L:Q"),
= ("L2:Q2") .Cells(x) = horizontal match.

I just can't make this one work.

Suggestions?

/Stromma


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA ComboBox

Hi Bob

Thanks for your reply!

Yes, i tried that without any luck...

The problem is solved with a great deal of help from Andy Pope on th
Ozgrid Forum: http://www.ozgrid.com/forum/

Here's the solution he provided:

Private Sub ComboBox3_Change()
If ComboBox3.ListIndex = 0 Then
ComboBox2.ListIndex = ComboBox3.ListIndex
MyFillCombo
End If
End Sub

Private Sub MyFillCombo()
Dim rngTemp As Range
ComboBox5.Clear
For Each rngTemp In Range("Start!L" & ComboBox3.ListIndex + 1
":O" & ComboBox3.ListIndex + 1)
ComboBox5.AddItem rngTemp.Value
Next
End Sub

/Stromm

--
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
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
combobox value flow23 Excel Discussion (Misc queries) 0 April 26th 06 12:21 PM
COMBOBOX GREGORY Excel Programming 1 December 4th 03 11:07 PM
combobox jim c Excel Programming 1 August 13th 03 02:16 AM
combobox Nicky* Excel Programming 3 July 28th 03 09:26 PM


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