Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
keeping a range a range object
I like assigning data kept in a range to a variant array where possible. I
see that when the range consists of only a single cell, the variant takes on the value of the cell and does not become an array (which makes sense). I just don't know how to keep it an array. Sample code below: Thanks! Private Function IDataStorageConnection_Connect() As Boolean Dim v As Variant v = DataRng <------ this ia an Xl data range MemoryStorage.VariantArray = v MemoryStorage.IMemoryStorage_PopulateMemory End Function |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
keeping a range a range object
Private Function IDataStorageConnection_Connect() As Boolean
Dim v As Variant Dim DataRng As Excel.Range Set DataRng = Range("B5") If DataRng.Count = 1 Then ReDim v(1 To 1) As Variant v(1) = DataRng.Value Else v = DataRng.Value End If MsgBox IsArray(v) ' MemoryStorage.VariantArray = v ' MemoryStorage.IMemoryStorage_PopulateMemory End Function -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "Eric Fingerhut" wrote in message I like assigning data kept in a range to a variant array where possible. I see that when the range consists of only a single cell, the variant takes on the value of the cell and does not become an array (which makes sense). I just don't know how to keep it an array. Sample code below: Thanks! Private Function IDataStorageConnection_Connect() As Boolean Dim v As Variant v = DataRng <------ this ia an Xl data range MemoryStorage.VariantArray = v MemoryStorage.IMemoryStorage_PopulateMemory End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
range property of range object | Excel Programming | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
using RANGE object in multiple-area range | Excel Programming | |||
Adding named range gives error "method range of object _Global failed " | Excel Programming |