Revision b351e201-4f8f-4ace-91d2-573b8f267e9c - Code Golf Stack Exchange

## VBA Excel (80 bytes, 1742 bytes) ##

----------


# Excel, 1742 bytes

Inspired by [the ugoren's creative answer](https://codegolf.stackexchange.com/a/87079/58742), I managed to find an Excel formula to create the pattern as shown in the OP.

 =MID(REPT("ABCDEFGHIJKLMNOPQRSTUVWXYZ",26),(ROW()-1)^2+1,2*ROW()-1)

Paste this formula in cell A1, then drag all over range A1:A26.


The length of the formula is 67 bytes but you have to replicate it 26 times, so it's equal to 67*26=1742 bytes. Here is the output:

[![enter image description here][1]][1]


----------

# Excel VBA, 80 bytes

Now it's possible we integrate Excel with VBA to automate the process and to save many bytes since VBA is built into most Microsoft Office applications, including Excel. Write and run the following code in the Immediate Window (use combination keys <kbd>CTRL</kbd>+<kbd>G</kbd> to display it in Visual Basic Editor):

 [A1:A26]="=MID(REPT(""ABCDEFGHIJKLMNOPQRSTUVWXYZ"",26),(ROW()-1)^2+1,2*ROW()-1)"

The program works by printing the Excel formula above to the range A1:A26. Unfortunately, both Excel and VBA have no built-in alphabet. 


 [1]: https://i.sstatic.net/jClc9.png

AltStyle によって変換されたページ (->オリジナル) /