Skip to content

Instantly share code, notes, and snippets.

@honda0510
Created October 7, 2012 04:31
Show Gist options
  • Save honda0510/3847111 to your computer and use it in GitHub Desktop.
Save honda0510/3847111 to your computer and use it in GitHub Desktop.
Option Explicit
Sub test()
Const MAX_NUM As Long = 65535
Dim num As Long
Dim row As Long
Dim col As Long
Dim result As Long
Dim table(0 To MAX_NUM, 0 To 15) As Long
ActiveSheet.UsedRange.ClearContents
row = -1
For num = 0 To MAX_NUM
row = row + 1
col = -1
result = num
Do Until result = 0
col = col + 1
table(row, col) = result Mod 2 ' 剰余
result = result \ 2 ' 商
Loop
Next num
Range("D1").Resize(MAX_NUM + 1, 16).Value = table
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment