I created a VBA code in Excel and upon running it, I get a strange behaviour. When I run the code it calls on a random function. A copy of the code is shown below:
Sub CreateSheet()
Dim rng As Range
On Error Resume Next
Set rng = ActiveSheet.Range(“A1”)
Range(“1:” & Rows.count).Clear
rng.Select
Cells(1, 1).Value = “Analysis Summary”
Cells(3, 2).Value = “Analysis was run for:”
Cells(3, 3).Formula = “=EPdiv2_white_mod!R[2000]C[-2]”
Cells(3, 4).Formula = “Perform analysis summary for the last:”
End Sub
I put the code in the Modules section of the VBA Project. Any idea why this happens?