Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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
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
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
range property of range object Woody[_3_] Excel Programming 1 June 23rd 05 09:04 PM
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
using RANGE object in multiple-area range TerryT Excel Programming 3 December 8th 04 09:13 PM
Adding named range gives error "method range of object _Global failed " Gunnar Johansson Excel Programming 3 August 10th 04 01:54 PM


All times are GMT +1. The time now is 05:20 AM.

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"