DEC | HEX | 文字 | DEC | HEX | 文字 | DEC | HEX | 文字 | DEC | HEX | 文字 | DEC | HEX | 文字 | DEC | HEX | 文字 | DEC | HEX | 文字 | DEC | HEX | 文字 |
0 | 00 | NUL(null文字) | 16 | 10 | DLE | 32 | 20 | 48 | 30 | 0 | 64 | 40 | @ | 80 | 50 | P | 96 | 60 | ` | 112 | 70 | p | |
1 | 01 | SOH | 17 | 11 | DC1 | 33 | 21 | ! | 49 | 31 | 1 | 65 | 41 | A | 81 | 51 | Q | 97 | 61 | a | 113 | 71 | q |
2 | 02 | STX | 18 | 12 | DC2 | 34 | 22 | " | 50 | 32 | 2 | 66 | 42 | B | 82 | 52 | R | 98 | 62 | b | 114 | 72 | r |
3 | 03 | ETX | 19 | 13 | DC3 | 35 | 23 | # | 51 | 33 | 3 | 67 | 43 | C | 83 | 53 | S | 99 | 63 | c | 115 | 73 | s |
4 | 04 | EOT | 20 | 14 | DC4 | 36 | 24 | $ | 52 | 34 | 4 | 68 | 44 | D | 84 | 54 | T | 100 | 64 | d | 116 | 74 | t |
5 | 05 | ENQ | 21 | 15 | NAK | 37 | 25 | % | 53 | 35 | 5 | 69 | 45 | E | 85 | 55 | U | 101 | 65 | e | 117 | 75 | u |
6 | 06 | ACK | 22 | 16 | SYN | 38 | 26 | & | 54 | 36 | 6 | 70 | 46 | F | 86 | 56 | V | 102 | 66 | f | 118 | 76 | v |
7 | 07 | BEL | 23 | 17 | ETB | 39 | 27 | ' | 55 | 37 | 7 | 71 | 47 | G | 87 | 57 | W | 103 | 67 | g | 119 | 77 | w |
8 | 08 | BS(後退) | 24 | 18 | CAN | 40 | 28 | ( | 56 | 38 | 8 | 72 | 48 | H | 88 | 58 | X | 104 | 68 | h | 120 | 78 | x |
9 | 09 | HT(水平タブ) | 25 | 19 | EM | 41 | 29 | ) | 57 | 39 | 9 | 73 | 49 | I | 89 | 59 | Y | 105 | 69 | i | 121 | 79 | y |
10 | 0a | LF(改行) | 26 | 1a | SUB | 42 | 2a | * | 58 | 3a | : | 74 | 4a | J | 90 | 5a | Z | 106 | 6a | j | 122 | 7a | z |
11 | 0b | VT(垂直タブ) | 27 | 1b | ESC | 43 | 2b | + | 59 | 3b | ; | 75 | 4b | K | 91 | 5b | [ | 107 | 6b | k | 123 | 7b | { |
12 | 0c | FF | 28 | 1c | FS | 44 | 2c | , | 60 | 3c | < | 76 | 4c | L | 92 | 5c | \ | 108 | 6c | l | 124 | 7c | | |
13 | 0d | CR(復帰) | 29 | 1d | GS | 45 | 2d | - | 61 | 3d | = | 77 | 4d | M | 93 | 5d | ] | 109 | 6d | m | 125 | 7d | } |
14 | 0e | SO | 30 | 1e | RS | 46 | 2e | . | 62 | 3e | > | 78 | 4e | N | 94 | 5e | ^ | 110 | 6e | n | 126 | 7e | ~ |
15 | 0f | SI | 31 | 1f | US | 47 | 2f | / | 63 | 3f | ? | 79 | 4f | O | 95 | 5f | _ | 111 | 6f | o | 127 | 7f |
Sub ASCコード例1() Dim ta As Integer Dim mydata As String mydata = "ABC" ms2$ = "を検索しました。" & Chr(10) & _ "この結果を「検索結果」シ−トへコピ−しますか?" ta = MsgBox("「" & mydata & "」 " & ms2$, 3, "検索結果") If ta = 2 Then Exit Sub ElseIf ta = 7 Then Call Macro2 Else Call Macro1 End If End Sub |
Sub ASCコード例2() Cells(1, 2) = "<A HREF=" & Chr(34) & "http://kuiryo.web.fc2.com/photo/" _ & Chr(34) & ">写真展示室</A>" End Sub ---------------------------------------------------------------- Sub ASCコード例2a() Cells(1, 2) = "<A HREF=""http://kuiryo.web.fc2.com/photo/"">写真展示室</A>" End Sub ---------------------------------------------------------------- Sub ASC参考例() kodo = "5401" sizyo = "t" Cells(1, 2) = "=RSS|'" & kodo & "." & sizyo & "'!高値" Cells(1, 4) = "" End Sub |
Sub ASCコード例2_1() Cells(1, 7).Formula = "=IF(A1=" ",0,(B1-A1)/A1)" '構文エラー End Sub ---------------------------------------------------------------- Sub ASCコード例2_2() Cells(2, 7).Formula = "=IF(A2=' ',0,(B2-A21)/A2)" 'オブジェクト定義のエラー End Sub ---------------------------------------------------------------- Sub ASCコード例2_3() Cells(3, 7).Formula = "=IF(A3="" "",0,(B3-A3)/A3)" End Sub ---------------------------------------------------------------- Sub ASCコード例2_4() Cells(4, 7).Formula = "=IF(A4=" & Chr(34) & " " & Chr(34) & ",0,(B4-A4)/A4)" End Sub ---------------------------------------------------------------- Sub ASCコード例2_5() Cells(5, 7).Formula = "=IF(A5=" & Chr(34) & Chr(32) & Chr(34) & ",0,(B5-A5)/A5)" End Sub |
Sub ASCコード例3() Range("B1").Select ActiveCell.Replace What:=Chr(10), Replacement:="", _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False Rows("1:1").EntireRow.AutoFit Range("A1").Select End Sub ---------------------------------------------------------- Sub ASCコード例3a() Dim mydat As Range Set mydat = Cells(1, 2) MsgBox "改行削除前データ→" & mydat mydat.Replace What:=Chr(10), Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=False MsgBox "改行削除後データ→" & mydat End Sub ---------------------------------------------------------- Sub ASC3確認文字記入() Cells(1, 2).Value = "abcdefg" & Chr(10) & "123456" End Sub |
Sub 改行削除() Cells(1, 2).Value = Replace(Cells(1, 2), vbLf, "") End Sub |
Sub ASCコード例4() Dim Myabc As String Dim cno As Integer Myabc = "H" cno = Asc(UCase(Myabc)) - 64 MsgBox "アルファベットの「" & Myabc & "」列は数字では【" & cno & "】列です。" |
※ASCコード65は[A]です。したがって-64で[A]は「1」となり、[H]は72-64で「8」となります |
Sub ASCコード例5() Dim sss As String sss = Chr(&H20) & Chr(&H20) & Chr(&H20) & Chr(&H20) & Chr(&H20) & Chr(13) Cells(1, 2) = "A0001B0002C0003" & sss End Sub |
Sub ASCコード例6() Dim msg As String Dim moz As String Dim moz1 As String Dim ascdat As String Dim i As Integer msg = "ASCコードをチェックするセルを指定して下さい" moz = Application.InputBox(msg, "セルの指定", Type:=8) i = 1: ascdat = "" Do moz1 = Mid(moz, i, 1) If moz1 = "" Then Exit Do End If ascdat = ascdat & moz1 & "[&H" & Hex(Asc(moz1)) & "] " i = i + 1 Loop MsgBox ascdat End Sub |
Sub ASCコード例6a() ・・・・ 下記以外は同上です ・・・・・・・・ ascdat = ascdat & moz1 & "[&H" & Hex(AscW(moz1)) & "] " |
Sub ASCコード例7() Dim moz As String moz = InputBox("ASCコ−ドを取得する1文字を入力してください。", "文字入力") If moz = "" Then Exit Sub End If MsgBox "文字「" & moz & "」のASCコ−ドは" & Chr$(10) & Chr$(10) _ & " →→ &H" & Hex(Asc(moz)) End Sub |
Sub ASCコード例8() Dim j As Integer j = 1 Do moz1 = Mid(Cells(1, 2), j, 1) If Asc(moz1) > 48 And Asc(moz1) < 57 Then MsgBox "銘柄コード→" & Mid(Cells(1, 2), j) Exit Do End If j = j + 1 Loop End Sub ----------------------------------------------------- Sub ASCコード例8a() Dim j As Integer For j = Len(Cells(1, 2)) To 1 Step -1 moz1 = Mid(Cells(1, 2), j, 1) If IsNumeric(moz1) = False Then Exit For End If Next MsgBox "銘柄コード→" & Mid(Cells(1, 2), j) End Sub |