|
▼無頼斎 さん:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim str As String
Dim rng As Range
If Not Application.Intersect(Range("g1:o65536"), Target) Is Nothing Then
'反応させたい行列の指定で…このサンプルはg列からo列が反応…出来るでしょう。
Application.EnableEvents = False
Application.ScreenUpdating = False
With Worksheets("sheet1")
For Each rng In Target
If Val(rng.Value) > 0 Then
str = .Cells(CLng(rng.Value), rng.Column).Value
rng.Value = str
End If
Next rng
End With
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
|
|