copying rows relative to a cell

Hannah

Board Regular
Joined
Aug 20, 2002
Messages
51
hi,
i want to copy the rows directly beneath a cell i have just located based on a string but don't know how to refer to them. For example say i've just found a value in a20, i want to copy all the rows below this starting at 21 and copying all rows until the first empty cell is found in column a.

With Worksheets(Worksheets.Count).Range("a1:h20")
Set C = .Find("j smith", LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address
Do
****in here i want to copy the rows - how do i refer to them?????????????

Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> firstAddress
End If
End With
 

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
Hi,

Try...<pre>Range(C.Offset(1, 0), C.Offset(1, 0).End(xlDown)).EntireRow.Copy</pre>

_________________
Bye,
Jay
This message was edited by Jay Petrulis on 2002-08-22 22:00
 
Upvote 0
hi,

i've inserted this,

Range(C.Offset(1, 0), C.Offset(1, 0).End(xlDown)).EntireRow.Copy _
after:=Workbooks("timesheet0507.xls").Sheets(Worksheets.Count)

but i'm getting an error that says the named arguement is not found......

and of course i have no idea why this is happening
 
Upvote 0

Forum statistics

Threads
1,223,460
Messages
6,172,345
Members
452,454
Latest member
MadamRedRabbit

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