Thread: copy rows
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Lawlera Lawlera is offline
external usenet poster
 
Posts: 37
Default copy rows

Sub loopcopy(
Dim target As Varian
target = "Asset
For a = 1 To Application.CountA(Sheets(1).Columns("a")
If Sheets(1).Cells(a, 1) = target Then GoSub hi
Next
Exit Su

hit
x = Application.CountA(Sheets(2).Columns("a")
Sheets(1).Rows(a).Copy Destination:=Sheets(2).Cells(x + 1, 1
Retur

End Su

HTH