|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- Dim rngData As Range, rngIntersection As Range
- Set rngData = [a2].CurrentRegion.Offset(1, 1)
- Set rngData = rngData.Resize(rngData.Rows.Count - 1, rngData.Columns.Count - 1)
- Set rngIntersection = Excel.Intersect(rngData, Target)
- If (Not rngIntersection Is Nothing) Then
- Shapes(1).Visible = True
- Shapes(1).Chart.SeriesCollection(1).Values = Excel.Intersect(Target.EntireRow, rngData)
- Else
- Shapes(1).Visible = False
- End If
- End Sub
复制代码 |
|