area in memory for calc

Please post any questions regarding the program here.

Moderator: 2020vision

area in memory for calc

Postby alrodopial » Sun Apr 08, 2012 7:54 am

It must be very simple but ...

How do I store a range with values in memory so I can make calculations in memory and not writing/reading from from excel?
eg. MyAREA = RANGE("A1:C5")

so later I can do eg myVAR = MyAREA.Cels(1,1).Value + MyAREA.Cells(1,1).Value
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby alrodopial » Sun Apr 08, 2012 8:23 am

If I
Code: Select all
set MyAREA = RANGE("A1:C5")

and then
MyAREA.Cels(1,1) = 0

it also changes the value of the first cell in the sheet .
I want the changes to be made only inside the code
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Postby NorthView » Sun Apr 08, 2012 9:33 am

I'm not sure this is possible, alrodopial. I guess MS would expect people to use VBA to hold values in memory instead.
NorthView
 
Posts: 174
Joined: Wed Oct 08, 2008 12:33 pm
Location: London

Postby osknows » Sun Apr 08, 2012 12:18 pm

Hi alrodopial,

You can use an array instead of a range object

Code: Select all
Option Explicit

Sub test()
Dim MyAREA() As Variant
Dim myVAR As Long

    With Sheet1

    MyAREA = .Range("A1:C5").Value
   
    End With
   
    myVAR = MyAREA(1, 1) + MyAREA(1, 1)

End Sub
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby alrodopial » Sun Apr 08, 2012 12:45 pm

Thanks os, it works fine,
Thanks north
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 68 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.