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
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