Hi,

I have an Excel app that starts and essentially runs within a few User Forms, using Sheets as a database.

I am trying here to select the Client's details stored in a Sheet and chosen by the user from a combo box in a User Form and display the Clients details in the same User Form by way of a few labels and Textboxes...
Public Function FillUpClientAddress(ByVal TheClientName As String)

    icompteur = 1
    sTemp = "A" + CStr(icompteur)
    
    Worksheets("ClientAddresses").Activate
    
    With Sheets("ClientAddresses")
    
        While Not CStr(.Range(sTemp).Value) = TheClientName
            
            icompteur = icompteur + 1
            sTemp = "A" + CStr(icompteur)
        
        Wend
        
        If .Range(sTemp).Value = TheClientNameThen
        
            
        
        End If
        
    End With
    
End Function
The problem is that the '.Range(sTemp)' is not defined in context (from the watch window) and I don't know what's wrong.

How can I achieve my purpose here?


Thank you!

Antoine