Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-16-2017, 07:07 PM
walber walber is offline Help with UserForm Windows 10 Help with UserForm Office 2016
Novice
Help with UserForm
 
Join Date: Jan 2017
Posts: 3
walber is on a distinguished road
Default Help with UserForm


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
Thanks in advance
Attached Files
File Type: xlsm Projeto.xlsm (330.1 KB, 15 views)

Last edited by macropod; 01-16-2017 at 08:06 PM. Reason: Added code tags
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform calls other userform, then populate worksheet Lehoi Excel Programming 0 02-03-2016 02:58 PM
Help with UserForm Help with VBA userform benn PowerPoint 1 03-02-2015 11:32 AM
Help with UserForm Keep Userform on Top 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
Help with UserForm Is it possible to take an input from a UserForm in one document to a UserForm in a do BoringDavid Word VBA 5 05-09-2014 09:08 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft