Extract rows with specific text in a column

T

TroyB

Hi,

I've got a large spreadsheet that I'd like to extract all the rows with the
words "PROVISIONAL QUANTITY" or "PROVISIONAL SUM" within the text in a
particular column.
ie - Some cells in Column C have the words "PROVISIONAL QUANTITY" or
"PROVISIONAL SUM" in the text somewhere. I need the data from the entire
row if col C has these words in the cell text.

I suspect this could be done by either 1) deleting all rows that dont
contain these words, or 2) selecting all the rows with the words and copying
into a blank worksheet.
Is there an easy way to achieve this or is a macro required. If macro
required, any help on the below macro would be great.

Sub ProvSumCopy()
Dim rng As Range
Dim cell As Range
Dim start_str As Integer

Set rng = Selection
For Each cell In rng
start_str = InStr(cell.Value, "PROVISIONAL SUM")
If start_str Then
ActiveRow.Select
End If
start_str = InStr(cell.Value, "PROVISIONAL QUANTITY")
If start_str Then
ActiveRow.Select
End If

Next

End Sub

Thanks
Troy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top