发布网友 发布时间:2022-04-23 05:22
共1个回答
热心网友 时间:2023-10-16 06:07
用下面代码
Private Sub Worksheet_Change(ByVal Target As Range)
Dim m As String
If Target.Row = 1 And Target.Column = 1 Then
m = Target.Value
With Sheets("Sheet2").Rows(m).Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
With Sheets("Sheet2").Rows(m).Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
With Sheets("Sheet2").Rows(m).Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
With Sheets("Sheet2").Rows(m).Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
End If
End Sub
代码放在
Excel怎样快速多表查找数据列表
追问好的,谢谢