excel VBA编程?

发布网友

我来回答

1个回答

热心网友

用下面代码

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怎样快速多表查找数据列表

追问好的,谢谢

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com