vlookup or something simliar

blacktour

Board Regular
Joined
May 24, 2005
Messages
219
I am trying to use a formula that will do this:

Data ranges from A1 to D50

I want to look for a word that is spreadout in the C column lets say "WORK"

Code:
  A             B           C            D
1words     more                  words
2words     more       WORK     words
3          more    WORK     words
4words     more                  words
5words     more    WORK     words
6words     more                  words

So for any row in column C that says "WORK" I want to extract it out and list it on another work sheet

so it ends up looking like this:
Code:
words     more    WORK     words
words     more    WORK     words
words     more    WORK     words

Hopefully thats not too confusing and can be done using a formula?

Thanks for your help,
Mike
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Sorry think a macro is the only solution

Paste the below code in the macro window ( Alt F8)


Code:
Sub copy_data()

Dim lr As Long

lr = Cells(Rows.Count, 1).End(xlUp).row
n = 1

'any text 'Work' in column 3 (C) the whole row will
' be copied over to Sheet2

For i = 1 To lr
If Cells(i, 3).Text = "Work" Then
  Rows(i).Copy
   Worksheets("Sheet2").Rows(n).PasteSpecial
  n = n + 1
 End If
Next i

Application.CutCopyMode = False

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,596
Messages
6,120,438
Members
448,966
Latest member
DannyC96

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top