Need more info. Does the value in B2 & C2 keep changing. Or are new values added below? If B2 & C2 are changed, it's not possible via formula and would require VBA solution.
Need more info. Does the value in B2 & C2 keep changing. Or are new values added below? If B2 & C2 are changed, it's not possible via formula and would require VBA solution.
Need more info.
Does the value in B2 & C2 keep changing. Or are new values added below?
If B2 & C2 are changed, it's not possible via formula and would require VBA solution.
1] To capture the highest value with dynamic range from col B, formula in D2 :
=MAX(B2:INDEX(B:B,MATCH(9.9E+307,B:B)))
2] To capture the lowest value with dynamic range from col C, formula in E2 :
=MIN(C2:INDEX(C:C,MATCH(9.9E+307,C:C)))
Edit : Maybe someone will suggust using :
=MAX(B:B)
and
=MIN(C:C)
But, it will involve 1 million cell calculation and affect the computer performance causing slow-down.
Regards
Bosco
n the sample,Wait... data is copied from D2:E2?
Isn't that where you want to store the high & low?
It would be better, if you can upload sample with demonstration of how numbers interact with each other.
I'm having hard time visualizing how your application works.
I know it's not done via formula. I assume there is code that does the job. I need to know what variables are used to write info and what triggers the code to run and how often?
This will impact subsequent code to write info to D & E column.
So it's calculated value via RTD function then.
This will be bit more complicated than when the values are pulled via code. I'm going into a meeting now. I'll have sample code for you tomorrow.
Sub IntiProcess()
Dim cel As Range
Dim exTime As String
For Each cel In ThisWorkbook.Worksheets("Sheet1").Range("F2:F27")
exTime = cel.Text
Application.OnTime TimeValue(exTime), "'RecValue """ & exTime & """'"
Next
End Sub
Sub RecValue(exTime As String)
Dim cel As Range
With ThisWorkbook.Worksheets("Sheet1")
For Each cel In .Range("F2:F27")
If exTime = cel.Text Then
cel.Offset(, -2).Value = .Range("B2").Value
cel.Offset(, -1).Value = .Range("C2").Value
End If
Next
End With
End Sub
This is probably the simplest way to accomplish what you are looking for.
Note that TimeValue only takes text string.
Code:Sub IntiProcess() Dim cel As Range Dim exTime As String For Each cel In ThisWorkbook.Worksheets("Sheet1").Range("F2:F27") exTime = cel.Text Application.OnTime TimeValue(exTime), "'RecValue """ & exTime & """'" Next End Sub Sub RecValue(exTime As String) Dim cel As Range With ThisWorkbook.Worksheets("Sheet1") For Each cel In .Range("F2:F27") If exTime = cel.Text Then cel.Offset(, -2).Value = .Range("B2").Value cel.Offset(, -1).Value = .Range("C2").Value End If Next End With End Sub
Hit Alt+F11 to launch VBE (editor).
Right click in Project pane. Insert->Module
Copy and paste the code I gave you.
On the sheet insert command button. Assign Macro and assign "IntiProcess" to it.
Without trial and error, you'll never learn.