Excel 如果匹配值,如何突出显示整行并滚动到它?

Excel 如果匹配值,如何突出显示整行并滚动到它?,excel,vba,Excel,Vba,我有一张有一系列名字的表1。我有一个msg框输入,在这里我可以单击引用该值的单元格。如果匹配,则在第2页的C列中找到该值所在的位置。它按我希望的方式工作,但我需要弄清楚如何突出显示整行。此外,是否有一个滚动到索引,我可以做,以确保它移动到第2页,该行突出显示的地方 代码: 编辑:至于卷轴,我只需要如下内容: Application. Goto ActiveCell.EntireRow,True 大概是这样的: With ThisWorkbook.Worksheets("Sheet2").Col

我有一张有一系列名字的表1。我有一个msg框输入,在这里我可以单击引用该值的单元格。如果匹配,则在第2页的C列中找到该值所在的位置。它按我希望的方式工作,但我需要弄清楚如何突出显示整行。此外,是否有一个滚动到索引,我可以做,以确保它移动到第2页,该行突出显示的地方

代码:

编辑:至于卷轴,我只需要如下内容:

Application. Goto ActiveCell.EntireRow,True
大概是这样的:

With ThisWorkbook.Worksheets("Sheet2").Columns("C")
    Set rFound = .Find(lemployee, .Cells(.Cells.Count), xlValues, xlWhole)
    If Not rFound Is Nothing Then
        rFound.EntireRow.Interior.Color = VBA.RGB(255, 255, 0)
        Application.Goto rFound
    End If
End With
大概是这样的:

With ThisWorkbook.Worksheets("Sheet2").Columns("C")
    Set rFound = .Find(lemployee, .Cells(.Cells.Count), xlValues, xlWhole)
    If Not rFound Is Nothing Then
        rFound.EntireRow.Interior.Color = VBA.RGB(255, 255, 0)
        Application.Goto rFound
    End If
End With

rFound.EntireRow.Interior.Color
如何实现滚动到sheet2上的值与消息框值匹配的活动行?
rFound.Select
将选择它,跳转到Excel文档中的该位置
rFound.EntireRow.Interior.Color
如何实现滚动到sheet2上的值与消息框值匹配的活动行?
rFound.Select
将选中它,跳转到Excel文档中的该位置