|
▼わいわい さん:
強引にユーザー定義関数を再計算させてみました。
遅い・・・。
Sheet1のモジュールに
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Rng As Range
Set Rng = Intersect(Target, Columns("C"))
Application.ScreenUpdating = False
Application.EnableEvents = False
If Rng Is Nothing Then
Call Y_Set(0)
Else
Call Y_Set(Target.Row)
End If
Cells.Replace What:="Ps_備考", Replacement:="Ps_備考", LookAt:=xlPart
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
標準モジュールに
Public Y As Long
Function Ps_備考(ByVal I As Long)
If Y > 0 And I > 0 And I < 3 Then
Ps_備考 = Cells(Y, 3 - I).Value
Else
Ps_備考 = ""
End If
End Function
Sub Y_Set(ByVal I As Long)
Y = I
End Sub
|
|