Skip to main content
4 of 6
Fixed number values in explanation to match original code. Added print explain to get to minimum edit size

#VBA (Excel), 105, 101 Bytes

Edit: -4 bytes from Keeta! Thanks!

Yeah, Excel beat VBA this time. Whatever.

d=vbCr:For i=0To[a1]:?IIf(i/3=i\3,"Yeah"&d,"")&IIf(i/2=i\2,"But"&d,"")&IIf(i Mod 3=1,"No"&d,"");:Next

^This is pasted into the Immediate window and outputs to the debug window

Ungolfed

d = vbCr
'For 1 to the value in A1 (using 0 gave extra values, and VBA skips the for loop if 0)
For i = 0 To [a1]    'aka: Range("A1").value
    'Print usually prints a newline, but it still outputs if the string is blank...
    '   So we append a newline -if true- and use a semi-colon to kill the newline
    'Keeta taught me that the \ operator is division with truncation,
    '     so if they are equal then there is no remainder!
    '? is the same as Print
    Print IIf(i \ 3 = i / 3,"Yeah" & d,"") & _ '<-- Just a line continuation
          IIf(i \ 2 = i / 2,"But" & d,"") & _
          IIf(i Mod 3 = 1,"No" & d,"");
Next