View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Copying whole lines based on one cell

Something like this may help with numbering

Sub fillnums()
Range(Cells(2, 1), Cells(1000, 1)).ClearContents
lastrow = ActiveSheet.UsedRange.Rows.Count
j = 1
For i = 2 To lastrow
If Rows(i).Hidden = False Then
Cells(i, 1) = j
j = j + 1
End If
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Hankjam" ........ wrote in message
...
I have a schedule sheet that I want to extract only the lines in which
have "PIP" in the Format column.

I could do it with a filter but that seems pretty messy on line
numbering.

vlookup only seems to extract the first observation.

Any help would be cool.

Thanks

Andrew j