Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Which is faster, copying range to another set of ranges or copying tomemory?

I am working with real time data and came across a problem where if
you the data is changing and you are trying to operate on the data,
you will get an automation problem. My solution, is to snapshot the
data, set it off to the side and then insert that data into a
database. This seems to work because a selection of range stops RTD
feeds.

I'm trying to get the fastest throughput possible. Would it be better
to operate on an in-memory array and then insert into the database or
copy/paste values to another set of cells and then operate on the
data?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default Which is faster, copying range to another set of ranges or copying to memory?

Would it be better to operate on an in-memory array and then insert into
the database or

copy/paste values to another set of cells and then operate on the data?

In memory ops are almost always faster than spreadsheet ops.

Sub SheetOp()
Dim StartTime As Double
Dim Counter As Long
StartTime = Timer
For Counter = 1 To 10000
Cells(Counter, 1).Value = Cells(Counter, 1).Value + 1
Next
MsgBox Timer - StartTime
End Sub

Sub MemoryOp()
Dim StartTime As Double
Dim Counter As Long
Dim Arr As Variant
StartTime = Timer
Arr = Range("A1:A10000").Value
For Counter = 1 To 10000
Arr(Counter, 1) = Arr(Counter, 1) + 1
Next
Range("A1:A10000").Value = Arr
MsgBox Timer - StartTime
End Sub

--
Jim
"axwack" wrote in message
...
|I am working with real time data and came across a problem where if
| you the data is changing and you are trying to operate on the data,
| you will get an automation problem. My solution, is to snapshot the
| data, set it off to the side and then insert that data into a
| database. This seems to work because a selection of range stops RTD
| feeds.
|
| I'm trying to get the fastest throughput possible. Would it be better
| to operate on an in-memory array and then insert into the database or
| copy/paste values to another set of cells and then operate on the
| data?
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Which is faster, copying range to another set of ranges orcopying to memory?

On Dec 11, 2:40 pm, "Jim Rech" wrote:
Would it be better to operate on an in-memory array and then insert into
the database or


copy/paste values to another set of cells and then operate on the data?

In memory ops are almost always faster than spreadsheet ops.

Sub SheetOp()
Dim StartTime As Double
Dim Counter As Long
StartTime = Timer
For Counter = 1 To 10000
Cells(Counter, 1).Value = Cells(Counter, 1).Value + 1
Next
MsgBox Timer - StartTime
End Sub

Sub MemoryOp()
Dim StartTime As Double
Dim Counter As Long
Dim Arr As Variant
StartTime = Timer
Arr = Range("A1:A10000").Value
For Counter = 1 To 10000
Arr(Counter, 1) = Arr(Counter, 1) + 1
Next
Range("A1:A10000").Value = Arr
MsgBox Timer - StartTime
End Sub

--
Jim"axwack" wrote in message

...
|I am working with real time data and came across a problem where if
| you the data is changing and you are trying to operate on the data,
| you will get an automation problem. My solution, is to snapshot the
| data, set it off to the side and then insert that data into a
| database. This seems to work because a selection of range stops RTD
| feeds.
|
| I'm trying to get the fastest throughput possible. Would it be better
| to operate on an in-memory array and then insert into the database or
| copy/paste values to another set of cells and then operate on the
| data?
|


Jim,

Thank you...you certainly put that one to bed.
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
Naming cell ranges, copying formulas for a range & nesting "IF" fu DonF Excel Discussion (Misc queries) 3 October 5th 06 05:47 PM
Copying ranges Don Lloyd Excel Programming 4 August 11th 05 11:19 PM
Copying into ranges carlito_1985 Excel Worksheet Functions 1 June 20th 05 03:23 AM
copying ranges etc chick-racer[_43_] Excel Programming 0 November 27th 03 02:33 PM
Copying ranges brym Excel Programming 8 July 19th 03 04:27 PM


All times are GMT +1. The time now is 12:48 PM.

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"