Userform help

ellin00ra

New Member
Joined
Oct 2, 2004
Messages
41
I have an userform that searches the row by name. But I need one textbox showing the data in column AD of that row in that textbox to be changed. How do I accomplish that?
I enclose the code here:
Code:
<< This finds the names & shows them in the list box >>
Private Sub UserForm_Activate() 
    Dim MyList(200, 1), M%, N% 
    Dim Cell As Range 
    Dim Top As Range 
    Dim Bottom As Range 
    Dim MyRange As Range 
    PrintButton.Enabled = False 
    With ListBox1 
        .ColumnCount = 1 
        .ColumnWidths = "60pt" ';35pt;35pt;35pt"
        .Width = 182 
        .Height = 200 
        .BoundColumn = 1 
        .ControlTipText = "Double-Click name to add to Print list" 
    End With 
    DoEvents '< allows time for the userform to load
    Application.ScreenUpdating = False 
    Sheets("Lista1").Activate 
    M = 0 
    Set Top = Range("Z2") 
    Set Bottom = Range("Z65536").End(xlUp).Offset(1, 0) 
    Set MyRange = Range(Top, Bottom) 
    For Each Cell In MyRange 
        If Cell Like "*" & NameToFind & "*" Then 
            MyList(M, 0) = Cell 
            M = M + 1 
        End If 
    Next Cell 
    ListBox1.List = MyList() 
    DoEvents '< allows time for the userform to update
    Sheets("Etsi").Activate 
End Sub

I'd be grateful for any hints:)
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Peter van Vliet

New Member
Joined
Feb 3, 2005
Messages
26
Hello Ellinora,

tyr this

Private Sub UserForm_ACTIVATE()
Call START_SUB
End Sub

Sub START_SUB()
put your code here
End Sub

Regards,
Peter
 

Watch MrExcel Video

Forum statistics

Threads
1,123,337
Messages
5,601,026
Members
414,422
Latest member
acegreen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top