1
セルがA2からA20まで その範囲内のセル値が変更されたときに新しいワークシートを生成しますか?セル(範囲内)変更後に新しいワークシートを作成
さらに、生成された新しいワークシートの名前が、変更されたセルの名前に変更されます。
範囲は以下のコードはRange("A2:A20")
内の値いったん新しいワークシートを作成したユーザー
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Dim ws As Worksheet
Dim lastrow As Long
lastrow = ActiveSheet.Cells(Rows.Count, "D").End(xlUp).Row + 1
Set KeyCells = Range("B5")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
For Each ws In Worksheets
With ActiveSheet
If .Range("B5").Value <> "" Then .Name = .Range("B5").Value
End With
Cells(lastrow, "D").Value = Range("B5").Value
End If
End Subの
完璧。ありがとう。ラストローとA2:A20は他の要求の一部でした。無視していただきありがとうございます。 – bermudamohawk
あなたのご歓迎、お返事ありがとうございます –