ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copying whole lines based on one cell (https://www.excelbanter.com/excel-discussion-misc-queries/177664-copying-whole-lines-based-one-cell.html)

Hankjam[_2_]

Copying whole lines based on one cell
 
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

Don Guillett

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




All times are GMT +1. The time now is 10:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com