如何提取细胞参考例如。 A1或B1 ..如果我在单元格内提供值。
EG。如果一个值“hello”存储在A1中,那么如果我提供你好,我应该能够得到A1作为输出。
答案 0 :(得分:1)
如果使用Excel-VBA,您可以使用.Find方法实现此目的,如下所示:
Sub FindValue()
Dim ws As Worksheet: Set ws = Worksheets("Sheet1")
'declare and set the worksheet, amend as required
Dim FoundVal As Range
'declare variable as range
Set FoundVal = ws.Cells.Find(What:="hello", LookAt:=xlWhole)
'find the value
If Not FoundVal Is Nothing Then 'if value found then
MsgBox FoundVal.Address
End If
End Sub