Hey guys,
I have a macro that runs automatically when a cell is updated automatically via RTD links. So to make this system work I need the code to run in a specific sheet in the background regardless of what sheet I may be on at the moment. I have some of the code working but I still haven't solved the background specific sheet part. This is what I have maybe someone can do the slight editing required to make it work? Thank you
Note: this code is in the microsoft excel objects in Sheet2(15 min bars)
I have a macro that runs automatically when a cell is updated automatically via RTD links. So to make this system work I need the code to run in a specific sheet in the background regardless of what sheet I may be on at the moment. I have some of the code working but I still haven't solved the background specific sheet part. This is what I have maybe someone can do the slight editing required to make it work? Thank you
Note: this code is in the microsoft excel objects in Sheet2(15 min bars)
VBA Code:
Public Prev_Val As Long
Private Sub Worksheet_Calculate()
Dim rngF3 As Range
Set rngF3 = Range("F2")
If rngF3 <> Prev_Val Then
Application.EnableEvents = False
Application.ScreenUpdating = False
With Sheets("15 Min Bars")
.Rows ("4:4")
.Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
With Sheets("15 Min Bars")
.Range("B2:E2").Copy
With Sheets("15 Min Bars")
.Range ("A4")
.Selection.PasteSpecial Paste:=xlPasteValues
End With
End With
End With
Application.CutCopyMode = False
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
End Sub