Hello, I saw that you helped a guy that got the same problema than me. So I guess that you can help me too :) could you?
I have a code to populate data to listbox and filter an specifict item by textbox.
But when it populate all data, blank rows came together and I want to clear them, IDK how can I do this! :X
Here's my code... - Sub FILTRO_TEXTO()
-
Application.ScreenUpdating = False
-
Application.DisplayAlerts = False
-
Dim Linha, linhalistbox As Integer
-
Dim valor_celula As String
-
linhalistbox = 1
-
Linha = 2
-
ListBox1.Clear
-
-
Sheets("Plan1").Select
-
With Sheets("Plan1")
-
-
While .Cells(Linha, 1).Value <> ""
-
valor_celula = .Cells(Linha, 1).Value <> ""
-
If UCase(Left(valor_celula, Len(TextBox1.Text))) = UCase(TextBox1.Text) Then
-
valor_celula = .Cells(Linha, 2).Value <> ""
-
If UCase(Left(valor_celula, Len(TextBox2.Text))) = UCase(TextBox2.Text) Then
-
valor_celula = .Cells(Linha, 3).Value <> ""
-
If UCase(Left(valor_celula, Len(TextBox3.Text))) = UCase(TextBox3.Text) Then
-
valor_celula = .Cells(Linha, 4).Value <> ""
-
If UCase(Left(valor_celula, Len(TextBox4.Text))) = UCase(TextBox4.Text) Then
-
valor_celula = .Cells(Linha, 5).Value <> ""
-
If UCase(Left(valor_celula, Len(TextBox5.Text))) = UCase(TextBox5.Text) Then
-
-
Me.ListBox1.ColumnWidths = "40;80;300;200"
-
Me.ListBox1.ForeColor = RGB(0, 0, 102)
-
-
With ListBox1
-
-
.AddItem
-
.List(0, 0) = "Ticket"
-
.List(0, 1) = "Projeto"
-
.List(0, 2) = "Descrição"
-
.List(0, 3) = "Responsável"
-
.List(0, 4) = "Status"
-
-
End With
-
-
With ListBox1
-
.AddItem
-
.List(linhalistbox, 0) = Sheets("Plan1").Cells(Linha, 1) 'Ticket
-
.List(linhalistbox, 1) = Sheets("Plan1").Cells(Linha, 2) 'Projeto
-
.List(linhalistbox, 2) = Sheets("Plan1").Cells(Linha, 3) 'Descrição
-
.List(linhalistbox, 3) = Sheets("Plan1").Cells(Linha, 4) 'Responsável
-
.List(linhalistbox, 4) = Sheets("Plan1").Cells(Linha, 5) 'Status
-
End With
-
linhalistbox = linhalistbox + 1
-
End If
-
End If
-
End If
-
End If
-
End If
-
-
Linha = Linha + 1
-
Wend
-
-
End With
-
-
Application.ScreenUpdating = True
-
Application.DisplayAlerts = True
-
-
End Sub
1 948 zmbd 5,501
Expert Mod 4TB
1) Link to the other thread so that we have some context
2) What have you tried already to fix this issue. We're happy to help; however, we don't wade thru tons of code - you have to have already done the basic troubleshooting.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Richard Yardley |
last post by:
I have a mailing label report and would like to remove the space taken up by
rows with no info (move the other rows up).
I am a beginner using MS Access 2000 and would appreciate any help.
...
|
by: Tamturr |
last post by:
Hello
I know I saw the answer to this question here a while ago (when I
didn't need the answer :) ) and I can't for the life of me find it, so
I apologize. My problem is this: I want to copy a...
|
by: New Guy |
last post by:
I've been trying to look this up in Help but I've had no luck because
I don't know what to call it. (That's not phrased very well but I
think you get what I mean.)
I have a report that is...
|
by: Husam |
last post by:
Hi EveryBody:
I made project by Vb.Net which consist the following items:
1\ Textbox
2\Button
3\Listbox
When you write any thing in the textbox and press the button any text
written in...
|
by: Drew |
last post by:
Hi all -
I've written a simple script to read a .csv file and then write out
rows to a new file only if the value in the 4th column is a 0. Here's
the code:
import csv
reader =...
|
by: padawanlinuxero |
last post by:
I have a program that goes to a MySQL table and puts all the data of the table in a CSV file, now I want to leave 6 rows in blank at top of the file when open in Excel, but I dont know how to do...
|
by: premMS143 |
last post by:
Hi 1 & all,
Using VB,
How to remove blank rows in a Excel worksheet?
For example,
I'm having a Excel sheet containing 900 rows data, in which there are blank rows inserted in between. Manually...
|
by: mrubel99 |
last post by:
I am trying to come up with a formula that from a value say in A1, will count itself and the number of blank rows, which will vary between values and change on a daily basis, to the next value in...
|
by: zmbd |
last post by:
So, I have the thread:
Has Anyone Attempted a Report for a Class Attendance Log?
I've managed to get the format... however, I decided that I would like to append enough rows so that that there...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |