Solved

populate cells from combo box

Posted on 2014-04-14
5
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

724 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