Skip to main content
Changed variable l to being global for -4
Source Link
Taylor Raine
  • 8.7k
  • 2
  • 27
  • 51

#Excel VBA, 687 686 686 685681 Bytes

From the problem statement:

However, I'm also rewarding other witty submissions with up-votes (and I encourage everybody to do so as well). Therefore although this is a code-golf contest, not-so-short answers are also welcome.

##Code

Full subroutine that takes no input and outputs a happy birthday song for VBA onto the range [A1:CM23] of the ActiveSheet object.

Global l
Sub a
Cells.RowHeight=48
For l=0To 3
p[A1:A5,B3,C1:C5,F1,E2:E5,G2:G5,F3,I1:I5,J1,K2,J3,M1:M5,N1,O2,N3,Q1:Q2,R3:R5,S1:S2],l
p[Y1:Y5,Z1,AA2,Z3,AA4,Z5,AC1:AE1,AD2:AD4,AC5:AE5,AG1:AG5,AH1,AI2,AH3,AI4:AI5,AK1:AM1,AL2:Al5,AO1:AO5,AP3,AQ1:AQ5,AS1:AS5,AT1,AU2:AU4,AT5,AX1,AW2:AW5,AY2:AY5,AX3,BA1:BA2,BB3:BB5,BC1:BC2],l
If l-2Then p[BI1:BK1,BJ2:BJ5,BN1,BM2:BM4,BN5,BO2:BO4,BU1:BU2,BV3:BV5,BW1:BW2,BZ1,BY2:BY4,BZ5,CA2:CA4,CC1:CC4,CD5,CE1:CE5],l ElseCE5]Else p[BI1:BI5,BJ1,BK2:BK4,BJ5,BM1:BM5,BN1:BO1,BN3,BN5:BO5,BR1,BQ2:BQ5,BS2:BS5,BR3,BU1:BU5,BV1,BW2,BV3,BW4:BW5,CC1:CC4,CD5,CE1:CE4,CG1:CG5,CH1,CI2,CH3,CI4,CH5,CL1,CK2:CK5,CM2:CM5,CL3],l
Next
End Sub
Sub p(r,l)
r.Offset(6*l,0).Interior.Color=0
End Sub

##Output

enter image description here

#Excel VBA, 687 686 685 Bytes

From the problem statement:

However, I'm also rewarding other witty submissions with up-votes (and I encourage everybody to do so as well). Therefore although this is a code-golf contest, not-so-short answers are also welcome.

##Code

Full subroutine that takes no input and outputs a happy birthday song for VBA onto the range [A1:CM23] of the ActiveSheet object.

Sub a
Cells.RowHeight=48
For l=0To 3
p[A1:A5,B3,C1:C5,F1,E2:E5,G2:G5,F3,I1:I5,J1,K2,J3,M1:M5,N1,O2,N3,Q1:Q2,R3:R5,S1:S2],l
p[Y1:Y5,Z1,AA2,Z3,AA4,Z5,AC1:AE1,AD2:AD4,AC5:AE5,AG1:AG5,AH1,AI2,AH3,AI4:AI5,AK1:AM1,AL2:Al5,AO1:AO5,AP3,AQ1:AQ5,AS1:AS5,AT1,AU2:AU4,AT5,AX1,AW2:AW5,AY2:AY5,AX3,BA1:BA2,BB3:BB5,BC1:BC2],l
If l-2Then p[BI1:BK1,BJ2:BJ5,BN1,BM2:BM4,BN5,BO2:BO4,BU1:BU2,BV3:BV5,BW1:BW2,BZ1,BY2:BY4,BZ5,CA2:CA4,CC1:CC4,CD5,CE1:CE5],l Else p[BI1:BI5,BJ1,BK2:BK4,BJ5,BM1:BM5,BN1:BO1,BN3,BN5:BO5,BR1,BQ2:BQ5,BS2:BS5,BR3,BU1:BU5,BV1,BW2,BV3,BW4:BW5,CC1:CC4,CD5,CE1:CE4,CG1:CG5,CH1,CI2,CH3,CI4,CH5,CL1,CK2:CK5,CM2:CM5,CL3],l
Next
End Sub
Sub p(r,l)
r.Offset(6*l,0).Interior.Color=0
End Sub

##Output

enter image description here

#Excel VBA, 687 686 686 681 Bytes

From the problem statement:

However, I'm also rewarding other witty submissions with up-votes (and I encourage everybody to do so as well). Therefore although this is a code-golf contest, not-so-short answers are also welcome.

##Code

Full subroutine that takes no input and outputs a happy birthday song for VBA onto the range [A1:CM23] of the ActiveSheet object.

Global l
Sub a
Cells.RowHeight=48
For l=0To 3
p[A1:A5,B3,C1:C5,F1,E2:E5,G2:G5,F3,I1:I5,J1,K2,J3,M1:M5,N1,O2,N3,Q1:Q2,R3:R5,S1:S2]
p[Y1:Y5,Z1,AA2,Z3,AA4,Z5,AC1:AE1,AD2:AD4,AC5:AE5,AG1:AG5,AH1,AI2,AH3,AI4:AI5,AK1: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2:CK5,CM2:CM5,CL3],l
Next
End Sub
Sub p(r,l)
r.Offset(6*l,0).Interior.Color=0
End Sub
added 10 characters in body
Source Link
Taylor Raine
  • 8.7k
  • 2
  • 27
  • 51

#Excel VBA, 687 686 686685 Bytes

From the problem statement:

However, I'm also rewarding other witty submissions with up-votes (and I encourage everybody to do so as well). Therefore although this is a code-golf contest, not-so-short answers are also welcome.

##Code

Full subroutine that takes no input and outputs a happy birthday song for VBA onto the range [A1:CM23] of the ActiveSheet object.

Sub a
Cells.RowHeight=48
For l=0To 3
p[A1:A5,B3,C1:C5,F1,E2:E5,G2:G5,F3,I1:I5,J1,K2,J3,M1:M5,N1,O2,N3,Q1:Q2,R3:R5,S1:S2],l
p[Y1:Y5,Z1,AA2,Z3,AA4,Z5,AC1:AE1,AD2:AD4,AC5:AE5,AG1:AG5,AH1,AI2,AH3,AI4:AI5,AK1:AM1,AL2:Al5,AO1:AO5,AP3,AQ1:AQ5,AS1:AS5,AT1,AU2:AU4,AT5,AX1,AW2:AW5,AY2:AY5,AX3,BA1:BA2,BB3:BB5,BC1:BC2],l
If l-2 Then2Then p[BI1:BK1,BJ2:BJ5,BN1,BM2:BM4,BN5,BO2:BO4,BU1:BU2,BV3:BV5,BW1:BW2,BZ1,BY2:BY4,BZ5,CA2:CA4,CC1:CC4,CD5,CE1:CE5],l Else p[BI1:BI5,BJ1,BK2:BK4,BJ5,BM1:BM5,BN1:BO1,BN3,BN5:BO5,BR1,BQ2:BQ5,BS2:BS5,BR3,BU1:BU5,BV1,BW2,BV3,BW4:BW5,CC1:CC4,CD5,CE1:CE4,CG1:CG5,CH1,CI2,CH3,CI4,CH5,CL1,CK2:CK5,CM2:CM5,CL3],l
Next
End Sub
Sub p(r,l)
r.Offset(6*l,0).Interior.Color=0
End Sub

##Output

enter image description here

#Excel VBA, 687 686 Bytes

From the problem statement:

However, I'm also rewarding other witty submissions with up-votes (and I encourage everybody to do so as well). Therefore although this is a code-golf contest, not-so-short answers are also welcome.

##Code

Full subroutine that takes no input and outputs a happy birthday song for VBA onto the range [A1:CM23] of the ActiveSheet object.

Sub a
Cells.RowHeight=48
For l=0To 3
p[A1:A5,B3,C1:C5,F1,E2:E5,G2:G5,F3,I1:I5,J1,K2,J3,M1:M5,N1,O2,N3,Q1:Q2,R3:R5,S1:S2],l
p[Y1:Y5,Z1,AA2,Z3,AA4,Z5,AC1:AE1,AD2:AD4,AC5:AE5,AG1:AG5,AH1,AI2,AH3,AI4:AI5,AK1:AM1,AL2:Al5,AO1:AO5,AP3,AQ1:AQ5,AS1:AS5,AT1,AU2:AU4,AT5,AX1,AW2:AW5,AY2:AY5,AX3,BA1:BA2,BB3:BB5,BC1:BC2],l
If l-2 Then p[BI1:BK1,BJ2:BJ5,BN1,BM2:BM4,BN5,BO2:BO4,BU1:BU2,BV3:BV5,BW1:BW2,BZ1,BY2:BY4,BZ5,CA2:CA4,CC1:CC4,CD5,CE1:CE5],l Else p[BI1:BI5,BJ1,BK2:BK4,BJ5,BM1:BM5,BN1:BO1,BN3,BN5:BO5,BR1,BQ2:BQ5,BS2:BS5,BR3,BU1:BU5,BV1,BW2,BV3,BW4:BW5,CC1:CC4,CD5,CE1:CE4,CG1:CG5,CH1,CI2,CH3,CI4,CH5,CL1,CK2:CK5,CM2:CM5,CL3],l
Next
End Sub
Sub p(r,l)
r.Offset(6*l,0).Interior.Color=0
End Sub

##Output

enter image description here

#Excel VBA, 687 686 685 Bytes

From the problem statement:

However, I'm also rewarding other witty submissions with up-votes (and I encourage everybody to do so as well). Therefore although this is a code-golf contest, not-so-short answers are also welcome.

##Code

Full subroutine that takes no input and outputs a happy birthday song for VBA onto the range [A1:CM23] of the ActiveSheet object.

Sub a
Cells.RowHeight=48
For l=0To 3
p[A1:A5,B3,C1:C5,F1,E2:E5,G2:G5,F3,I1:I5,J1,K2,J3,M1:M5,N1,O2,N3,Q1:Q2,R3:R5,S1:S2],l
p[Y1:Y5,Z1,AA2,Z3,AA4,Z5,AC1:AE1,AD2:AD4,AC5:AE5,AG1:AG5,AH1,AI2,AH3,AI4:AI5,AK1:AM1,AL2:Al5,AO1:AO5,AP3,AQ1:AQ5,AS1:AS5,AT1,AU2:AU4,AT5,AX1,AW2:AW5,AY2:AY5,AX3,BA1:BA2,BB3:BB5,BC1:BC2],l
If l-2Then p[BI1:BK1,BJ2:BJ5,BN1,BM2:BM4,BN5,BO2:BO4,BU1:BU2,BV3:BV5,BW1:BW2,BZ1,BY2:BY4,BZ5,CA2:CA4,CC1:CC4,CD5,CE1:CE5],l Else p[BI1:BI5,BJ1,BK2:BK4,BJ5,BM1:BM5,BN1:BO1,BN3,BN5:BO5,BR1,BQ2:BQ5,BS2:BS5,BR3,BU1:BU5,BV1,BW2,BV3,BW4:BW5,CC1:CC4,CD5,CE1:CE4,CG1:CG5,CH1,CI2,CH3,CI4,CH5,CL1,CK2:CK5,CM2:CM5,CL3],l
Next
End Sub
Sub p(r,l)
r.Offset(6*l,0).Interior.Color=0
End Sub

##Output

enter image description here

added 21 characters in body
Source Link
Taylor Raine
  • 8.7k
  • 2
  • 27
  • 51
Loading
Source Link
Taylor Raine
  • 8.7k
  • 2
  • 27
  • 51
Loading