0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

完成画像

登録シート

登録シート

一覧

一覧

VBA

Sub 一覧登録()
     Dim name  As String
     Dim content As String
     Dim no
     
     name = Worksheets("登録シート").Range("C2").Text
     content = Worksheets("登録シート").Range("C4").Text
     
     If name = "" Then
        MsgBox ("項目名が入力されていません ")
     ElseIf content = "" Then
        MsgBox ("内容が入力されていません ")
     Else
        no = Worksheets("一覧").Range("B2").End(xlDown).Value
        
        If no = "No." Then
            no = 1
        Else
            no = no + 1
            
            Worksheets("一覧").Range("B2").End(xlDown).Offset(1, 0).Value = no
            Worksheets("一覧").Range("B2").End(xlDown).Offset(0, 1).Value = name
            Worksheets("一覧").Range("B2").End(xlDown).Offset(0, 2).Value = content
            Worksheets("一覧").Range("B2").End(xlDown).Offset(0, 3).Value = Now
        
            Worksheets("登録シート").Range("C2").ClearContents
            Worksheets("登録シート").Range("C4").ClearContents
        End If
    End If
End Sub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?