You might find it easier to work down rather than across. In each column you want (3^(column number -1)) of ones, then the same of twos, then of threes. This is then repeated. Only the last column only loops through once.
I made a start on the code (and it is only a start):
Dim R As Range, MaxCol As Byte, Ctr As Byte, MaxRw As Integer, Col As Range
Set R = Range("A:U")
MaxCol = R.Columns.Count
MaxRw = 3 ^ (MaxCol - 1)
For Ctr = 1 To MaxCol
Set Col = R.Columns(Ctr)
Range(Col.Cells(1), Col.Cells(3 ^ (Ctr - 1))).Value = 1
Next Ctr
...then I realised that to complete this you will need 10,460,353,203 rows, which is somewhat more than Excel can handle.
I can have a further look next week if you like, but it looks like you may need to rethink.
Bookmarks