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:)
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hello Ellinora,

tyr this

Private Sub UserForm_ACTIVATE()
Call START_SUB
End Sub

Sub START_SUB()
put your code here
End Sub

Regards,
Peter
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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
Back
Top