Hey guys, sorry im stuck on this small issue. I'd like to copy and paste a row but not copy paste the values only, id like to copy the formulas as well just like you would do a normal ctrl-C and ctrl-V function on excel. The current code I have works perfectly fine for pasting values but not for pasting the formula as well. I tried variations along these lines .Range("G2:Y2").Copy = .Range("G4:Y4") but it doesn't work. I'd like to insert the code right below .Range("A4:F4").Value = .Range("A2:F2").Value
I'm simply trying to copy cells G2-Y2 and paste them in G4-Y4
Here is the full code
Anyone have any ideas, thanks very much
I'm simply trying to copy cells G2-Y2 and paste them in G4-Y4
Here is the full code
VBA Code:
Public ninetyPrev_Val As Variant
Private Sub Worksheet_Calculate()
Dim ninetyF2 As Range
With ThisWorkbook.Sheets("90 Min Bars")
Set ninetyF2 = .Range("F2")
If ninetyF2.Value <> ninetyPrev_Val Then
Application.EnableEvents = False
Application.ScreenUpdating = False
.Rows("4:4").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
.Range("A4:F4").Value = .Range("A2:F2").Value
; .Range("G2:y2").Copy = .Range("G2:y2") copy and paste code would go here
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
End With
ninetyPrev_Val = ninetyF2.Value
End Sub
Anyone have any ideas, thanks very much