用下面代码
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怎样快速多表查找数据列表
追问好的,谢谢本文如未解决您的问题请添加抖音号:51dongshi(抖音搜索懂视),直接咨询即可。