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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Stephan Hoenselaar

New Member
Joined
Jul 11, 2007
Messages
40
"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!
 

Forum statistics

Threads
1,181,102
Messages
5,928,072
Members
436,586
Latest member
latintxn

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