Skip to main content
6 of 8
added 192 characters in body
Taylor Raine
  • 8.7k
  • 2
  • 27
  • 51

Excel VBA, 48 47 46 22 21 Bytes

Immediates Window Function

Anonymous VBE Immediates Windows Function that takes input of the expected type Variant\Integer and from cell [A1] outputs to the VBE immediates window

For I=1To[A1]:?I:Next

Old Subroutine Version

Code:

Sub F(N):For I=1To N:Cells(I, 1)=I:Next:End Sub

Usage:

Sub Test(): F 100: End Sub

Changes:

-24 Bytes for converting to Immediates Window Function

-1 Byte for condensing I=1 To to I=1To

-1 Byte thanks to Engineer Toast for Changing Cells(I,1) to Debug.?

-1 Byte for removing whitespace


##Output to ActiveSheet, 30 Bytes

Anonymous VBE immediate window function that takes input from range [A1] and outputs to the range [1:1]

[A1].Resize([A1],1)="=Row(A1)"
Taylor Raine
  • 8.7k
  • 2
  • 27
  • 51