Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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
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
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 6 November 9th 05 05:54 AM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 1 November 8th 05 04:21 AM
ReDim Object array as parameter of Variant array Peter T Excel Programming 4 May 10th 05 02:11 PM
Variant Array Steph[_3_] Excel Programming 1 June 2nd 04 01:29 AM
variant array containing cel adresses convert to actual ranges-array Peter[_21_] Excel Programming 5 December 10th 03 09:50 PM


All times are GMT +1. The time now is 04:32 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"