|
把代码粘贴在Sheet1下,自动执行。
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count = 1 Then Exit Sub
Set findcell = Sheet1.Cells.Find("日期", LookAt:=xlWhole)
If Not findcell Is Nothing Then
daterow = findcell.Row
Sheet1.Shapes.Range(Array("Rectangle 1")).Left = Sheet1.Cells(findcell.Row, findcell.Column).Offset(1, 2).Left
Sheet1.Shapes.Range(Array("Rectangle 1")).Top = Sheet1.Cells(findcell.Row, findcell.Column).Offset(1, 2).Top
Sheet1.Shapes.Range(Array("Rectangle 2")).Left = Sheet1.Cells(findcell.Row, findcell.Column).Offset(1, 2).Left
Sheet1.Shapes.Range(Array("Rectangle 2")).Top = Sheet1.Cells(findcell.Row, findcell.Column).Offset(1, 2).Top + 25
End If
End Sub
|
评分
-
1
查看全部评分
-
|