Solved

populate cells from combo box

Posted on 2014-04-14
5
161 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

759 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

20 Experts available now in Live!

Get 1:1 Help Now