|
thisworkbookにこんな感じだけど、エラー処理してません。
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim SHNm As String, ERw As Long
If Target.Column = 1 Then
If Target.Value = "転送" Then
If Sh.Name = "Sheet1" Then
SHNm = "Sheet2"
ElseIf Sh.Name = "Sheet3" Then
SHNm = "Sheet4"
End If
If SHNm <> "" Then
ERw = Sheets(SHNm).Range("B" & Rows.Count).End(xlUp).Row + 1
If ERw < 3 Then
ERw = 3
End If
Sheets(SHNm).Range("B" & ERw & ":H" & ERw).Value = _
Target.Offset(, 1).Resize(, 7).Value
End If
End If
End If
End Sub
|
|