search and copy into a new worksheet

kendals

Board Regular
Joined
May 19, 2007
Messages
55
Hi I would like to search a for the word "Lower" and copy the rows that contain that word into a new worksheet. how can i do this?

thanks
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
"Lower"

kendals
I don't know if you are familiar with VBA but your VBA text should look something like:

Sub Button_Click()
' Macro by Hoenselaar, 2007-08-03
Dim lngCounter1 As Long
Dim lngCounter2 As Long
lngCounter1 = 1
lngCounter2 = 1

Do While Not Worksheets("Sheet1").Cells(lngCounter1, 1) = ""
If Worksheets("Sheet1").Cells(lngCounter1, 1) = "Lower" Then
Worksheets("Sheet1").Select
Rows(lngCounter1).Copy
Worksheets("Sheet2").Select
Rows(lngCounter2).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation_
:=xlNone, SkipBlanks:=False, Transpose:=False
lngCounter2 = lngCounter2 + 1
End If
lngCounter1 = lngCounter1 + 1
Loop
End Sub

P.s. Lay out is incorrect tabs are missing!
 
Upvote 0

Forum statistics

Threads
1,214,388
Messages
6,119,226
Members
448,878
Latest member
Da9l87

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