Move row if specific word is found in row of text

Muppett

New Member
Joined
Sep 26, 2016
Messages
10
Hi all

I am fairly new to VBA and trying to move rows if a certain word is found in a cell in a row of text.

So ie:

Column E has a title of Known As - this column then has names of premises such as "Made up name school".

I need a way of moving every row to another sheet when this "school" is found...

VOICRENT to VOICRENTSCHOOLS

I have a HUGE spread sheet and simply filtering copy paste is gonna take FAR longer then coding..
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I was thinking something more like this to be honest.. but need it to see school in a row of text in one column... now teh below works fine BUT I would have to have a column that has School in each cell that i needed moving which defeats what im trying to achieve..

Sub School()


Set i = Sheets("VOICRENT")
Set e = Sheets("VOICRENTSCHOOLS")
Dim d
Dim j
d = 1
j = 2


Do Until IsEmpty(i.Range("E" & j))


If i.Range("E" & j) = "School" Then
d = d + 1
e.Rows(d).Value = i.Rows(j).Value


End If
j = j + 1
Loop


End Sub
 
Upvote 0
Ah, so the issue is you want to physically move the records out of the original sheet to the new sheet. Is that correct?

Can you post a small data sample to show what the data you are working with looks like?
And if you want the "archived" list to look any different from your original (as far as columns go), please post an example of that as well.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

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