最终我做了什么(我只需要扫描第一列):
在功能区中的AN EDITBOX更新一个变量,其范围是我的模块。
我使用的代码(可以肯定的是简单,但可能会帮助其他初学者(例如我)):
Private nomPatientRecherche As String
Public Sub RecherchePatient(control As IRibbonControl)
Dim feuille As Worksheet, zone As Range, cellule As Range
For Each feuille In ThisWorkbook.Worksheets
feuille.Activate
Set zone = feuille.Range("A2:A" & ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row)
For Each cellule In zone
If Not cellule.Find(nomPatientRecherche) Is Nothing Then
cellule.Activate
If Not MsgBox("Continuer ?", vbOKCancel, "Continuer ?") = vbOK Then
Exit Sub
End If
End If
Next cellule
Next feuille
End Sub
Public Sub DefineNomPatientRecherche(control As IRibbonControl, nom As String)
nomPatientRecherche = nom
End Sub
再次感谢@Rory寻求帮助