Calender

S M T W T F S
    123
45678910
11121314151617
18192021222324
25262728293031
<< August 2019 >>

Categories

Archives

Recent Entries

中学生のためのExcel VBA

3-14 郵便番号と住所()エラー回避

JUGEMテーマ:Office VBA

 

Private Sub CommandButton2_Click()
Call hani
    Cells(gyou + 1, "s").Value = TextBox1.Text
Cells(gyou + 1, "s").NumberFormatLocal = "000-0000"
Range("t4:x4").Copy
Cells(gyou + 1, "t").PasteSpecial (xlPasteFormulas)
Application.CutCopyMode = False
If IsError(Cells(gyou + 1, "x").Value) Then
    MsgBox "郵便番号が違います。" , 16
  TextBox2.Text = ""
       With TextBox1
            .SetFocus
            .SelStart = 0
            .SelLength = Len(.Text)
        End With
  Else
Cells(gyou + 1, "w").Value = ""
TextBox2.Text = Cells(gyou + 1, "x").Value
 End If
End Sub
 

  • 2019.05.25 Saturday
  • 17:36

Comment
Send Comment