View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Israel[_2_] Israel[_2_] is offline
external usenet poster
 
Posts: 2
Default Macro to copy exactly the I number of times that he/she appears in the column

hi
i have a problem with this codigo

I want to copy exactly the I number of times that AV appears in the
column but I have not achieved it, they could also check since the
code it is the I finish that I lack it of my work, and appears me an
error in ELSE and not you if to remove or to put is beginner in Visual
basic
i would thank them they to help me

Sub Botón437_AlHacerClic()
Dim Origen As Range, Fila As Integer, Veces As Byte, Filas As Long
Fila = 8
Busca:
If Worksheets("Automatizacion A5,NB").Range("bh" & Fila) = "" Then
GoTo Salida
On Error Resume Next
With Worksheets("Proc.base")
Set Origen = .Cells.Find( _
What:=Worksheets("Automatizacion A5,NB").Range("a" & Fila), _
After:=.Range("bh3"), _
LookAt:=xlWhole)
If Not Origen Is Nothing Then
For Veces = 1 To Worksheets("Automatizacion A5,NB").Range("av" &
Fila)
Origen.Resize(9).EntireRow.Copy _
Destination:=Worksheets("hoja3").Cells(Rows.Count,
"a").End(xlUp).Offset(2)
'Rellenar filas
For Filas = Worksheets("Automatizacion
A5,NB").Cells(Rows.Count, 1).End(xlUp).Row _
To 1 Step -1
Worksheets("Automatizacion A5,NB").Cells(Fila, 61).Copy _
Destination:=Worksheets("Hoja3").Cells(Rows.Count,
5).End(xlUp).Offset(3).Resize(8)
Next
Else: MsgBox Worksheets("Automatizacion
A5,NB").Range("a" & Fila) & " NO se encuentra !!!"
End If
End With
Fila = Fila + 1
GoTo Busca
Salida:
Set Origen = Nothing

end sub



Thanks