Coying Cells in an colum untill keyword found

Parth13

Board Regular
Joined
Dec 24, 2008
Messages
65
Hi, I am trying to write a code which should select and copy all the values in an column say "A" untill a keyword "Recieved" found in the next cell. It can "Recieved"+Any other text. No success till now :confused:. If anybody can help here!
Thanks.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Thanks Sharpefiction, but this is not really I am looking for. In my case, the keyword containing cell will come only once, it'll act as a partition as data above that has to be copied to separate sheet.
 
Upvote 0
Success atlast, used the following code to search a keyword down the column and then copy all rows above the row containing the keyword.

Range("A1").Select
Cells.Find(What:="Receiver", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveSheet.Cells(ActiveCell.Row - 2, 1).Activate
Range(Selection, Selection.End(xlUp)).EntireRow.Select

Selection.Copy
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,172
Members
452,893
Latest member
denay

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