get editbox值on“返回带有vba

问题描述 投票:0回答:1
感谢您寻求帮助。

最终我做了什么(我只需要扫描第一列):

在功能区中的AN EDITBOX更新一个变量,其范围是我的模块。

vba excel ribbonx
1个回答
1
投票

我使用的代码(可以肯定的是简单,但可能会帮助其他初学者(例如我)):

    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寻求帮助

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.