【问题标题】:Excel 2016 -How do I seach for the value in workbook 1 cell A1 in workbook 2 range $G:$R?Excel 2016 - 如何在工作簿 2 范围 $G:$R 中搜索工作簿 1 单元格 A1 中的值?
【发布时间】:2016-09-30 05:18:52
【问题描述】:

Excel 2016 - Excel 工作簿 1 在 A:A 中有一个值列表;不同的 Excel 工作簿可能在 $G:$K 列中具有这些值之一。如何在工作簿 2 范围 $G:$R 中搜索工作簿 1 单元格 A1 中的值?

【问题讨论】:

标签: excel


【解决方案1】:

从这里开始并根据您的需要进行更改:

Sub JustOneCell()
    Dim r1 As Range, r2 As Range, r3 As Range

    Set r1 = Workbooks("Book1").Sheets("Sheet1").Range("A1")
    Set r2 = Workbooks("Book2").Sheets("Sheet1").Range("G:R")
    Set r3 = r2.Find(What:=r1.Value, After:=r2(1))

    MsgBox r3.Address
End Sub

【讨论】:

    猜你喜欢
    • 2020-03-13
    • 1970-01-01
    • 1970-01-01
    • 2021-08-29
    • 1970-01-01
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多