Solved

populate cells from combo box

Posted on 2014-04-14
5
166 Views
Last Modified: 2014-05-11
I have a combo box that the user selects a value, once the value is select i would like to populate the cells from the the combo box columns i am currently using a loop,but i would to   accomplished this in one pass.
let's say range("ao17: at17") must be populated from cbobox column 1 to 6
0
Comment
Question by:Svgmassive
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
Kimputer earned 500 total points
ID: 39998695
Try this:

Private Sub ComboBox1_Change()

    Range("ao17").Value = ComboBox1.List(ComboBox1.ListIndex, 0)
    Range("ap17").Value = ComboBox1.List(ComboBox1.ListIndex, 1)
    Range("aq17").Value = ComboBox1.List(ComboBox1.ListIndex, 2)
    Range("ar17").Value = ComboBox1.List(ComboBox1.ListIndex, 3)
    Range("as17").Value = ComboBox1.List(ComboBox1.ListIndex, 4)
    Range("at17").Value = ComboBox1.List(ComboBox1.ListIndex, 5)
    
End Sub

Open in new window

0
 

Author Comment

by:Svgmassive
ID: 40001060
kimputer not exactly what i am looking for
0
 
LVL 35

Expert Comment

by:Kimputer
ID: 40002412
In that case, more details would be nice. As you can see, all selected items populate the cells you mentioned in one go.
0
 

Author Comment

by:Svgmassive
ID: 40025646
can this be done in one line of code? i would  rather use a loop which i am currently using if this can't be accomplished
0
 
LVL 35

Expert Comment

by:Kimputer
ID: 40025724
Then the answer is no
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cascading dropdown 9 29
highlight duplicate entry 16 31
Merging-Splitting-Multiple-Rows 33 46
min values in series 13 14
Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now