LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 345
Default Vartype, range uninitialized ? Feb2010

Hi All,
I don't understand why in the second MsgBox
the vartype displays as 0 when vTest appears to
be initialized with the right values.

Thanks,
Neal Z.


Sub Test()

Dim vTest As Variant

Set vTest = ActiveSheet

MsgBox VarType(vTest) & " =vartype", , TypeName(vTest)
' vartype shows 9 for object Worksheet


Set vTest = ActiveSheet.Range("b10")

MsgBox VarType(vTest) & " =vartype" _
& vbCr & vTest.Worksheet.Name _
& vbCr & vTest.Address, , TypeName(vTest)
' vartype shows 0 ?, mso docum says uninitialized
' yet the sheet name and address show OK ??
' TypeName shows Range
End Sub
--
Neal Z
 
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
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Vartype() and vbObject Neal Zimm Excel Programming 4 December 15th 08 06:24 AM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Passing variable to VarType of other Variable ExcelMonkey[_190_] Excel Programming 3 February 22nd 05 01:38 PM
Question about VarType [email protected] Excel Programming 2 August 7th 03 01:21 AM


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