VBA Selenium Dynamic ID (Wildcard)
This code is tested in Excel VBA using Selenium.
Option Explicit
Sub sbXPathContains()
    Dim driver As ChromeDriver
    Set driver = New ChromeDriver
    Dim sURL As String
    sURL = "https://davetallett26.github.io/table.html"
    Call driver.Start("edge")
    driver.get (sURL)
    driver.Window.Maximize
    sbDelay (100000)
    MsgBox driver.FindElementByXPath("//*[contains(@id, 'ctl03_txtCash')]").Attribute("outerHTML")
    '                                 //* = any element  contains  @id = within id  'ctl03_txtCash' = string to find   .Attribute("outerHTML") = return HTML of the element
    sbDelay (100000)
    driver.Quit
End Sub

Sub sbDelay(delay As Long): Dim i As Long: For i = 1 To delay:  DoEvents: Next i: End Sub


Is there a possibility to find an element by ID with an wildcard?
I have something like this:
stat = GC.FindElementByXPath("//*[@id='C29_W88_V90_V94_admin_status']").Value
stat = GC.FindElementByXPath("//*[@id='C26_W88_V90_V94_admin_status']").Value
stat = GC.FindElementByXPath("//*[@id='C29_W88_V12_V94_admin_status']").Value

The admin_status part won't change but the values before.
Sometimes I have the same problem with another element with values around it. So the best thing would be to find the element with some wildcard like this:
stat = GC.FindElementByXPath("//*[@id='*admin_status*']").Value

