CODE PROBLEM

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Help appreciated

I have the following code:

Private Sub ComboBox1_Change()
With Me.ComboBox1.TopLeftCell
..Offset(0, 5) = "NIN"
..Offset(0, 6) = "NOUT"
..Offset(0, 7) = "ZALT"
..Offset(0, 8) = "ZDTAMB"
..Offset(0, 9) = "ZDT1A"
..Offset(0, 10) = "ZERM1A"
..Offset(0, 11) = "ZPWXH"

However the .Offset mode to generate the list in quotes is a long list.
Is there a more compact way of generating this same list?
 
Maybe this

With Me.ComboBox1.TopLeftCell
.Offset(0, 5).Resize(, 4) = _
Array("NIN", "NOUT", "ZALT", "ZDTAMB")
End With

Why not copy the values in a range on your sheet and hide it
You can copy it then in one step
 
Thank YOU RON!

Ron de Bruin said:
Maybe this

With Me.ComboBox1.TopLeftCell
.Offset(0, 5).Resize(, 4) = _
Array("NIN", "NOUT", "ZALT", "ZDTAMB")
End With

Why not copy the values in a range on your sheet and hide it
You can copy it then in one step
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top