79639497

Date: 2025-05-26 19:57:57
Score: 1
Natty:
Report link

I think you are missing an equal sign for the .FormulaR1C1 here is one Sub that should work:

Sub Macro12()
'
' Macro12 Macro
'
Dim i As Integer

For i = 1 To 64
    Cells(i, 1).FormulaR1C1 = "=<Element Index=""[" & (i + 1) &"]"" Value=""0""/>"
Next i

End Sub

As @VBasic2008 pointed out, this should give you <Element Index="[2]" Value="0"/> in A1.

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @VBasic2008
  • Low reputation (0.5):
Posted by: Leyth