私は以下のコードをオンラインで入手できましたが、今はそれを複数のセル、 "列。これはどうすればいいですか?ターゲットセルが複数のセルの範囲内にあるかどうかをテストする方法:Excel VBA
私は元のコードを書いていないので、それを編集する方法については適切な手がかりがありません。私が納得させたいのはTarget.Address
だと理解していますが、私が使用しようとしているロジックはデバッガのエラーにしかなりません。
Dim Oldvalue As String
Dim Newvalue As String
On Error GoTo Exitsub
If Target.Address = "$I$1" Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
Target.Value = Oldvalue & ", " & Newvalue
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
このコードはどこにありますか?シートチェンジイベントで?それは何を意味するのですか? –
'Column I'では' If Target.Column = 9 Then'を試します。 – Mrig