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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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