- ©«¤l
- 14
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 16
- ÂI¦W
- 0
- §@·~¨t²Î
- win 10
- ³nÅ骩¥»
- office 2010
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2018-1-29
- ³Ì«áµn¿ý
- 2018-2-14
|
¥»©«³Ì«á¥Ñ JasonChen576 ©ó 2018-1-29 13:13 ½s¿è
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Set KeyCells = Range("A1:A5")
Dim myShtName As String
myShtName = KeyCells.Worksheet.Name
Dim myRowsNum As Integer
myRowsNum = Selection.Rows.Count
Dim myShtµ²ªG As Worksheet
Set myShtµ²ªG = Worksheets("µ²ªG")
Dim myAddressOfTarget As String
Dim i As Integer
If Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then Exit Sub
For i = 0 To myRowsNum - 1 - Target.Row
myAddressOfTarget = Target.Resize(1).Offset(i, 0).Address(0, 0, xlA1, 1, 1)
myShtµ²ªG.Cells(Target.Row + i, "B") = "=" & myAddressOfTarget & "*5"
Next i
End Sub |
|