Populate TextBox with other textbox value
Hello,
.... Private Sub UserForm_Initialize() Me.UserName = Environ("username") .... I have two textbox that I fill it based on the value of first textbox (UserName) Taking the data in a sheet called "Users" with fields (Username, Name_FirstName, Phone) Thanks in advance Yves |
Populate TextBox with other textbox value
hello Yves,
Private Sub UserForm_Initialize() Dim sUserName As String, x As Integer sUserName = Environ("username") With Sheets("Users") If Not IsError(Application.Match(sUserName, .Range("A:A"), 0)) Then x = Application.Match(sUserName, .Range("A:A"), 0) TextBox1 = .Range("A" & x) TextBox2 = .Range("B" & x) TextBox3 = .Range("C" & x) End If End With End Sub -- isabelle |
Populate TextBox with other textbox value
Hello Isabelle,
Big Thanks to you. Yves hello Yves, Private Sub UserForm_Initialize() Dim sUserName As String, x As Integer sUserName = Environ("username") With Sheets("Users") If Not IsError(Application.Match(sUserName, .Range("A:A"), 0)) Then x = Application.Match(sUserName, .Range("A:A"), 0) TextBox1 = .Range("A" & x) TextBox2 = .Range("B" & x) TextBox3 = .Range("C" & x) End If End With End Sub |
All times are GMT +1. The time now is 05:27 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com