Update cell's value without refresh screen?

L

lantiger

I am having a hard time with a function that update cell values.

I have a function that get market data from a DLL, and it will updat
the corresponding excel cells.

It works ok, the problem is whenever a cell update, excel refresh th
entire screen, sometime values from inactive worksheet can be see i
that cell has colored background formate. I CANNOT us
application.screenupdate =true/false because of the frequency of marke
update (means this function get called maybe twice every second).
Calculation is set to manual so that should not be the problem?


Here is a snap shot of that function

Private Function UpdateCell(byval R as range, byval v as collection
byval header as string)

application.enableEvents = false

Select Case(header)

case "LAST"
'use to be R.Value = value, but cells seems to be faster
application.Worksheets(Name).Cells(R.row, R.Column).Value = v.Last
case "HIGH"
application.Worksheets(Name).Cells(R.row, R.Column).Value = v.High
case "LOW"
application.Worksheets(Name).Cells(R.row, R.Column).Value = v.Low

application.enableEvents = true

end function

Thanks for your time and any input you have. I really approciate it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top