• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

populate cells from combo box

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
Svgmassive
Asked:
Svgmassive
  • 3
  • 2
1 Solution
 
KimputerCommented:
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
 
SvgmassiveAuthor Commented:
kimputer not exactly what i am looking for
0
 
KimputerCommented:
In that case, more details would be nice. As you can see, all selected items populate the cells you mentioned in one go.
0
 
SvgmassiveAuthor Commented:
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
 
KimputerCommented:
Then the answer is no
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now