#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 65
Default CODE PROBLEM

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?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default CODE PROBLEM

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

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"N.F" wrote in message ...
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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 65
Default CODE PROBLEM

Thank YOU RON!

"Ron de Bruin" wrote:

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

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"N.F" wrote in message ...
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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VB Code Problem Stan Excel Discussion (Misc queries) 6 April 25th 07 01:48 AM
XLS to CSV Code Problem carl Excel Worksheet Functions 0 March 28th 07 01:21 AM
Strange problem with Code PH NEWS Excel Worksheet Functions 1 September 27th 06 10:16 AM
Little problem with this code... simonsmith Excel Discussion (Misc queries) 11 May 21st 06 04:02 AM
Can anyone figure this code problem please simonsmith Excel Discussion (Misc queries) 1 May 18th 06 08:20 PM


All times are GMT +1. The time now is 03:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"