Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default MORE combobox questions

I have the following code:

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

How do i tell the program that instead of me inputing the "NIN, "NOUT",
"ZALT" values myself in the Array command to simply have an something like:

Array("Sheet2!C2:C5)
The reason I want this is because I have a very long list I would other wise
need to input in the Array Command.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default MORE combobox questions

Dim v as Variant
v = worksheets("Sheet1").Range("C2:C5").Value

v is now a 4 x 1 2-dimensional array.

but why not do

With Me.ComboBox1.TopLeftCell
..Offset(0, 5).Resize(, 4) = Application.Transpose( _
Worksheets("Sheet1").Range("C2:C5"))
End with

--
Regards,
Tom Ogilvy






"N.F" wrote:

I have the following code:

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

How do i tell the program that instead of me inputing the "NIN, "NOUT",
"ZALT" values myself in the Array command to simply have an something like:

Array("Sheet2!C2:C5)
The reason I want this is because I have a very long list I would other wise
need to input in the Array Command.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default MORE combobox questions

ONE MORE QUESTION...
WHat is the function of the command line: Resize(, 4) in my code below?
It seems to limit my list to only displaying 4 outputs. How would I go about
not having a limit but rather to show simply the range C2:C5 or any other
range without me having to change the Resize(,4) value

"Tom Ogilvy" wrote:

Dim v as Variant
v = worksheets("Sheet1").Range("C2:C5").Value

v is now a 4 x 1 2-dimensional array.

but why not do

With Me.ComboBox1.TopLeftCell
.Offset(0, 5).Resize(, 4) = Application.Transpose( _
Worksheets("Sheet1").Range("C2:C5"))
End with

--
Regards,
Tom Ogilvy






"N.F" wrote:

I have the following code:

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

How do i tell the program that instead of me inputing the "NIN, "NOUT",
"ZALT" values myself in the Array command to simply have an something like:

Array("Sheet2!C2:C5)
The reason I want this is because I have a very long list I would other wise
need to input in the Array Command.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default MORE combobox questions

somerng.resize(x,y)
will resize that original range (somerng) so that it's x rows by y columns.

If you don't give it an x or y, then that row or column isn't changed.

So in Tom's code:
Me.ComboBox1.TopLeftCell.Offset(0, 5).Resize(, 4)
He started in the .topleftcell
went 5 columns to the right, but stayed on the same row (.offset(0,5))
and then made the range the same number of rows (1) but with 4 columns.

And he used 4 because there are 4 cells in C2:C5.




N.F wrote:

ONE MORE QUESTION...
WHat is the function of the command line: Resize(, 4) in my code below?
It seems to limit my list to only displaying 4 outputs. How would I go about
not having a limit but rather to show simply the range C2:C5 or any other
range without me having to change the Resize(,4) value

"Tom Ogilvy" wrote:

Dim v as Variant
v = worksheets("Sheet1").Range("C2:C5").Value

v is now a 4 x 1 2-dimensional array.

but why not do

With Me.ComboBox1.TopLeftCell
.Offset(0, 5).Resize(, 4) = Application.Transpose( _
Worksheets("Sheet1").Range("C2:C5"))
End with

--
Regards,
Tom Ogilvy






"N.F" wrote:

I have the following code:

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

How do i tell the program that instead of me inputing the "NIN, "NOUT",
"ZALT" values myself in the Array command to simply have an something like:

Array("Sheet2!C2:C5)
The reason I want this is because I have a very long list I would other wise
need to input in the Array Command.


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default MORE combobox questions

Ok I see. Now that youre here Dave, I was wondering if you know how to have a
"Reset" command button that will erase the list that was displayed by my
following code:

Private Sub ComboBox1_Change()
If Me.ComboBox1.Value = "F" Then
With Me.ComboBox1.TopLeftCell
..Offset(0, 5).Resize(, 4) = Application.Transpose( _
Worksheets("Sheet1").Range("C2:C5"))
End With
End If
End Sub





"Dave Peterson" wrote:

somerng.resize(x,y)
will resize that original range (somerng) so that it's x rows by y columns.

If you don't give it an x or y, then that row or column isn't changed.

So in Tom's code:
Me.ComboBox1.TopLeftCell.Offset(0, 5).Resize(, 4)
He started in the .topleftcell
went 5 columns to the right, but stayed on the same row (.offset(0,5))
and then made the range the same number of rows (1) but with 4 columns.

And he used 4 because there are 4 cells in C2:C5.




N.F wrote:

ONE MORE QUESTION...
WHat is the function of the command line: Resize(, 4) in my code below?
It seems to limit my list to only displaying 4 outputs. How would I go about
not having a limit but rather to show simply the range C2:C5 or any other
range without me having to change the Resize(,4) value

"Tom Ogilvy" wrote:

Dim v as Variant
v = worksheets("Sheet1").Range("C2:C5").Value

v is now a 4 x 1 2-dimensional array.

but why not do

With Me.ComboBox1.TopLeftCell
.Offset(0, 5).Resize(, 4) = Application.Transpose( _
Worksheets("Sheet1").Range("C2:C5"))
End with

--
Regards,
Tom Ogilvy






"N.F" wrote:

I have the following code:

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

How do i tell the program that instead of me inputing the "NIN, "NOUT",
"ZALT" values myself in the Array command to simply have an something like:

Array("Sheet2!C2:C5)
The reason I want this is because I have a very long list I would other wise
need to input in the Array Command.


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default MORE combobox questions

Put a button from the Control Toolbox toolbar and use this code under it:

Option Explicit
Private Sub CommandButton1_Click()
With Me.ComboBox1.TopLeftCell
.Offset(0, 5).Resize(, 4).clearcontents
End With
End Sub

N.F wrote:

Ok I see. Now that youre here Dave, I was wondering if you know how to have a
"Reset" command button that will erase the list that was displayed by my
following code:

Private Sub ComboBox1_Change()
If Me.ComboBox1.Value = "F" Then
With Me.ComboBox1.TopLeftCell
.Offset(0, 5).Resize(, 4) = Application.Transpose( _
Worksheets("Sheet1").Range("C2:C5"))
End With
End If
End Sub

"Dave Peterson" wrote:

somerng.resize(x,y)
will resize that original range (somerng) so that it's x rows by y columns.

If you don't give it an x or y, then that row or column isn't changed.

So in Tom's code:
Me.ComboBox1.TopLeftCell.Offset(0, 5).Resize(, 4)
He started in the .topleftcell
went 5 columns to the right, but stayed on the same row (.offset(0,5))
and then made the range the same number of rows (1) but with 4 columns.

And he used 4 because there are 4 cells in C2:C5.




N.F wrote:

ONE MORE QUESTION...
WHat is the function of the command line: Resize(, 4) in my code below?
It seems to limit my list to only displaying 4 outputs. How would I go about
not having a limit but rather to show simply the range C2:C5 or any other
range without me having to change the Resize(,4) value

"Tom Ogilvy" wrote:

Dim v as Variant
v = worksheets("Sheet1").Range("C2:C5").Value

v is now a 4 x 1 2-dimensional array.

but why not do

With Me.ComboBox1.TopLeftCell
.Offset(0, 5).Resize(, 4) = Application.Transpose( _
Worksheets("Sheet1").Range("C2:C5"))
End with

--
Regards,
Tom Ogilvy






"N.F" wrote:

I have the following code:

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

How do i tell the program that instead of me inputing the "NIN, "NOUT",
"ZALT" values myself in the Array command to simply have an something like:

Array("Sheet2!C2:C5)
The reason I want this is because I have a very long list I would other wise
need to input in the Array Command.


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default MORE combobox questions

THANK YOU SO MUCH. I was struggling with this problem for over two hours!!
THANK YOU TOM
"N.F" wrote:

I have the following code:

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

How do i tell the program that instead of me inputing the "NIN, "NOUT",
"ZALT" values myself in the Array command to simply have an something like:

Array("Sheet2!C2:C5)
The reason I want this is because I have a very long list I would other wise
need to input in the Array Command.

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
Answers to questions posing more questions in a workbook sbelle1 Excel Worksheet Functions 2 August 8th 09 01:02 AM
View Questions and Answer to questions I created Roibn Taylor Excel Discussion (Misc queries) 4 July 24th 08 12:05 AM
2 questions! Related to combobox and time function. HELP!! Bruno Excel Discussion (Misc queries) 11 September 28th 07 02:33 PM
More combobox questions lc Excel Programming 1 September 6th 05 06:12 PM
Questions About ComboBox Chaplain Doug Excel Programming 3 February 25th 05 02:51 PM


All times are GMT +1. The time now is 06:01 AM.

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

About Us

"It's about Microsoft Excel"