掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
制御文を使って簡単にするには? (ID:108486)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
簡単な処理方法がわかりません。ご指導かださいませんか? Public Sub Enter() Dim col As Long Dim row As Long Dim SN As Long col = ActiveCell.Column row = ActiveCell.row If (col = 1) Then If (row > 2) Then SN = CLng(Right(Cells(row - 1, col).Value, 3)) + 1 Cells(row, col).Value = "EP481200DD" & " 25013/" & Format(CStr(SN), "000") End If Cells(row, col + 1).Select ElseIf (col = 2) Then If (row > 2) Then SN = CLng(Right(Cells(row - 1, col).Value, 3)) + 1 Cells(row, col).Value = "EP443800EE" & " 25013/" & Format(CStr(SN), "000") End If Cells(row, col + 1).Select ElseIf (col = 3) Then If (row > 2) Then SN = CLng(Right(Cells(row - 1, col).Value, 3)) + 1 Cells(row, col).Value = "EP443901FG" & " 25013/" & Format(CStr(SN), "000") End If Cells(row + 1, 1).Select ElseIf (col = 3) Then Cells(row, row).Select End If End Sub どうしたらいいでしょう?
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.