Trying to find all instances of a client name and copy the range into a new workbook

EVANWIT84

New Member
Joined
Sep 25, 2020
Messages
22
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
Hi All,

I'm trying to find all instances of a client name and copy the range into a new workbook where I want to perform a calculation. These are my headers and I want to do a find on the client account number, such as 5 and then copy the range. My existing range runs from A1:I71573. I have about 900 client Account Numbers to loop thru. Any suggestions on how to use the Find Function to then find all and copy the dynamic range? The workbook that I will then copy these values to is called "CalcSheet".


Client Account NumberClient Master Account NameClent Account NamePeriodContributionWithdrawalEnding Market ValueNet ReturnInception Date

Thanks,
Evan
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi Evan

Using advanced filter might be the easiest solution for this.

This is under Data>Advanced (Sort & Filter) in the ribbon. Make sure you select the sheet you want to copy to before clicking it.

Thank you...this is what I wound up doing. It basically just copies the values I need.

Sub Many_Finds()

Dim CompId As Range
Dim i As Byte
Dim FirstMatch As Variant
Dim h As Long
Dim lstCell As Long

lstCell = [b1048567].End(xlUp).Row
i = 3

'Dim Start
'Start = VBA.Timer

Sheets("CalcSheet").Range("a1:i1000").ClearContents ' Destination
Set CompId = Sheet1.Range("A:I").Find("5", LookIn:=xlValues, lookat:=xlWhole)

If Not CompId Is Nothing Then
Sheets("CalcSheet").Range("B" & i).Value = CompId.Offset(, 7).Value
FirstMatch = CompId.Address
Do
Set CompId = Sheet1.Range("A:A").FindNext(CompId)
If CompId.Address = FirstMatch Then Exit Do
i = i + 1

Sheets("CalcSheet").Range("B" & i).Value = CompId.Offset(, 7).Value

Loop
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

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