![]() |
#1
|
|||
|
|||
![]() good evening everyone I searched on websites and did not find my answer. How do I get this code to work when I click G16 line from the Menu spreadsheet according to the template attachment. Code:
Option Explicit Private TextoDigitado As String Private Sub ListBox1_Click() ActiveCell.Value = ListBox1.Value Unload Me End Sub Private Sub TextBox1_Change() TextoDigitado = TextBox1.Text Call PreencheLista End Sub Private Sub UserForm_Initialize() Call PreencheLista End Sub Private Sub PreencheLista() Dim ws As Worksheet Dim i As Integer Dim TextoCelula As String Set ws = ThisWorkbook.Worksheets(2) i = 2 ListBox1.Clear With ws While .Cells(i, 2).Value <> Empty TextoCelula = .Cells(i, 2).Value If UCase(Left(TextoCelula, Len(TextoDigitado))) = UCase(TextoDigitado) Then ListBox1.AddItem .Cells(i, 2) End If i = i + 2 Wend End With End Sub Last edited by macropod; 01-16-2017 at 08:06 PM. Reason: Added code tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Userform calls other userform, then populate worksheet | Lehoi | Excel Programming | 0 | 02-03-2016 02:58 PM |
![]() |
benn | PowerPoint | 1 | 03-02-2015 11:32 AM |
![]() |
didjee | PowerPoint | 5 | 10-20-2014 02:22 PM |
VBA Code in a UserForm module to delete a Command Button which opens the userform | Simoninparis | Word VBA | 2 | 09-21-2014 03:50 AM |
![]() |
BoringDavid | Word VBA | 5 | 05-09-2014 09:08 AM |