0% found this document useful (0 votes)
18 views3 pages

Dim Numerodedatos

The document describes a process to search for data in Excel based on a search term. It counts the number of rows, loops through each row to check for a match, and copies matching data to a text box. Finally, it copies the text box data to a new row.

Uploaded by

rocio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Dim Numerodedatos

The document describes a process to search for data in Excel based on a search term. It counts the number of rows, loops through each row to check for a match, and copies matching data to a text box. Finally, it copies the text box data to a new row.

Uploaded by

rocio
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Dim numerodedatos

numerodedatos = ActiveSheet.Range("B" & Rows.Count).End(xlUp).Row

Y=0

For fila = 2 To numerodedatos

codigo = ActiveSheet.Cells(fila, 2).Value

If UCase(codigo) Like "*" & UCase(Me.ComboBox2.Value) & "*" Then

Me.TextBox2.AddItem

Me.TextBox2.List(Y, 0) = Sheet1.Cells(fila, 2).Value

Me.TextBox2.List(Y, 1) = Sheet1.Cells(fila, 3).Value

Me.TextBox2.List(Y, 2) = Sheet1.Cells(fila, 4).Value

Me.TextBox2.List(Y, 3) = Sheet1.Cells(fila, 5).Value

Me.TextBox2.List(Y, 4) = Sheet1.Cells(fila, 6).Value

Y=Y+1

End If

Next
Dim xfil As Integer

Range(“A19”).Activate

Xfil=activateCell.CurrentRegion.Rows.Count

ActiveCell.pffset(xfil,0)=TextBox1.Text

ActiveCell.pffset(xfil,1)=TextBox2.Text

ActiveCell.pffset(xfil,2)=TextBox3.Text

ActiveCell.pffset(xfil,3)=TextBox4.Text

ActiveCell.pffset(xfil,4)=TextBox5.Text

If Target.Column=1AndTarget.Row>20Then

If Target.Row=21Then

Cells(Target.Row,1).Value=
Sub BuscarDatos()
Application.ScreenUpdating = False
On Error Resume Next
DisplayAlerts = False

Dim numerodedatos

You might also like