Hi,
I would like to copy a formula from Sheet2 to Sheet1 so that the references do not change.
For example I have formula
in cell E5 of Sheet2.
If I copy this formula to cell G8 of Sheet1 using code
the corresponding formula that I will get in cell G8 of Sheet1 will be
.
I would like to amend the code so that formula that is copied in cell G8 of Sheet1 remains
so does not change references.
How would I do that?
Thanks,
Nic
I would like to copy a formula from Sheet2 to Sheet1 so that the references do not change.
For example I have formula
Excel Formula:
=IF(AND(E$3>=$C5,E$3<=$C5),$D5,"")
If I copy this formula to cell G8 of Sheet1 using code
VBA Code:
Worksheets("Sheet2").Activate
Range("E5").Select
Selection.copy
Sheets("Sheet1").Select
Range("G8").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
the corresponding formula that I will get in cell G8 of Sheet1 will be
Excel Formula:
=IF(AND(G$3>=$C8,G$3<=$C8),$D8,"")
I would like to amend the code so that formula that is copied in cell G8 of Sheet1 remains
Excel Formula:
=IF(AND(E$3>=$C5,E$3<=$C5),$D5,"")
How would I do that?
Thanks,
Nic