Variant and Array

  • Thread starter Thread starter spencer.sadkin
  • Start date Start date
S

spencer.sadkin

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
 
Maybe try

msgbox var(1, 1)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
You need to discover what var really is. First exanime IsArray(var) and then
look at the Ubound and Lbound values.
 
Maybe try

msgbox var(1, 1)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)











- Show quoted text -

msgbox var(1,1) worked thanks
 

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