Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variant and Array
I have a class with variable called pSW
I pass a range ("A1:A5") as variant and set the property. I then use var= classname.sw and set var which is dimmed as variant with no problems if i then say worksheets(1).range("B1:B5")=var the values display properly. however if say say msgbox var(1) i get a subscript out of range error. any ideas on why this might be? thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variant and Array
Maybe try
msgbox var(1, 1) -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message ... I have a class with variable called pSW I pass a range ("A1:A5") as variant and set the property. I then use var= classname.sw and set var which is dimmed as variant with no problems if i then say worksheets(1).range("B1:B5")=var the values display properly. however if say say msgbox var(1) i get a subscript out of range error. any ideas on why this might be? thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variant and Array
You need to discover what var really is. First exanime IsArray(var) and then
look at the Ubound and Lbound values. -- Gary''s Student - gsnu2007L " wrote: I have a class with variable called pSW I pass a range ("A1:A5") as variant and set the property. I then use var= classname.sw and set var which is dimmed as variant with no problems if i then say worksheets(1).range("B1:B5")=var the values display properly. however if say say msgbox var(1) i get a subscript out of range error. any ideas on why this might be? thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variant and Array
On May 21, 12:43*pm, "Bob Phillips" wrote:
Maybe try msgbox var(1, 1) -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message ... I have a class with variable called pSW I pass a range ("A1:A5") as variant and set the property. I then use var= classname.sw *and set var which is dimmed as variant with no problems if i then say worksheets(1).range("B1:B5")=var the values display properly. however if say say msgbox var(1) i get a subscript out of range error. any ideas on why this might be? *thanks- Hide quoted text - - Show quoted text - msgbox var(1,1) worked thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming | |||
Array problem: Key words-Variant Array, single-element, type mismatch error | Excel Programming | |||
ReDim Object array as parameter of Variant array | Excel Programming | |||
Variant Array | Excel Programming | |||
variant array containing cel adresses convert to actual ranges-array | Excel Programming |