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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Paddy1979

Well-known Member
Joined
Sep 23, 2005
Messages
608
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,037
Messages
5,856,966
Members
431,841
Latest member
jaybeem

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
Top