Hello all,
I currently have the following Macro --- it basically is looking at a session low price and increasing it by .0001 until it is equal to the session high. Here is the code:
Sub increment()
Range("E8:E5000").ClearContents
i = 1
j = 0
Do Until Range("D4").Value = Range("E7").Offset(j, 0).Value
Range("E7").Offset(i, 0).Value = Range("E7").Offset(j, 0).Value + 0.0001
j = j + 1
i = i + 1
Loop
End Sub
What I want to do is stack a worksheet change event on top of this so that when the session low changes, the sheet dynamically updates the prices too. I don't know much VBA so I don't know how to write something else to call this. I saw examples of the worksheet change event, and I tried to implement them but I was unsuccessful. I tried this but I dont know the syntax or if I have to put this before my other macro on Sheet 1, in a separate module, etc (again, no VBA experience):
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$3" Then
Call increment
End If
End Sub
Not sure how to call my macro and how to stack these. Anyone have any ideas?
Last caveat I forgot to put is that D3 is actually a formula, not a static number, so I think I am not using the right sub.
Bookmarks