Return specific results between two cells then repeat

Blizzardx23

New Member
Joined
Oct 18, 2016
Messages
20
Hi guys!

I'm not new here...I have an older account but no idea what email or username I had back in 2016 (Could have been an old employer email).. sorry =(


So I've done a search and couldn't really come up with what I'm looking to do specifically..

I have a report that provides me with the following information (below)
In this report, it lists (columns) days that payments are past due and the amount past due per job/employee
For the rows, it gives the client name, then below that..it lists the specific employee that worked that job. It then lists client name again with the word "total" at the end.

What I'm wanting to do..is in another worksheet (titled "Dr. Cola Inc. - DROLA") I want it to find "Client Name: Dr. Cola Inc. - DROLA" then list each row/column until it finds the word "Total" at which point, it will stop.

On the next worksheet, it will do the same, but for "Orange Bottom Jeans" (In the worksheet that I've made for that client)



Worksheet 1 has this


NET
Gross
30days
60days
90days
120days
150days
180days

Client Name: Dr. Cola Inc. - DROLA

<tbody>
</tbody>
STAFFING ------Can Man - Joe Dirt
$92
$92
92

STAFFING ------Customer Service Rep - Tony Stark

<tbody>
</tbody>
$57
$57
57

STAFFING ------Customer Service Rep - Harry Toeknee

<tbody>
</tbody>
$100
$100
100

STAFFING ------Customer Service Rep - Tim Taylor

<tbody>
</tbody>
$10
$10
10

STAFFING ------Customer Service Rep - Alphabet Eddy

<tbody>
</tbody>
$1000
$1000
1000

STAFFING ------Customer Service Rep - Lawk Jaw

<tbody>
</tbody>
$9857
$9857
9857

STAFFING ------Customer Service Rep - Needa Lyfe

<tbody>
</tbody>
$8000
$8000
8000

STAFFING ------Customer Service Rep - Roger Rabbit

<tbody>
</tbody>
$600
$600
600

STAFFING ------Customer Service Rep - Didyuh Whin

<tbody>
</tbody>
$54
$54
54

STAFFING ------Customer Service Rep - Sally Shameful

<tbody>
</tbody>
$200
$200
200

STAFFING ------Customer Service Rep - Mie Mawm

<tbody>
</tbody>
$7
$7
7

Dr. Cola Inc. - DROLA Total

<tbody>
</tbody>
$19,977
$19,977
207
8054
1600
9857
102
157

Client Name: Orange Bottom Jeans - ORJNS

<tbody>
</tbody>

STAFFING ------Temp - Rhine Peal

<tbody>
</tbody>
$564
$564
564

Orange Bottom Jeans - ORJNS Total

<tbody>
</tbody>
$564
$564
564

Client Name: SillyGurhl Solutions- SLYGRL

<tbody>
</tbody>

STAFFING ------Temp Services - Stukup Silverman

<tbody>
</tbody>
$16720
$16720
16720

SillyGurhl Solutions- SLYGRL Total

<tbody>
</tbody>
$16720
$16720
16720

<tbody>
</tbody>




Worksheet 2, I want it to give me these results



Client Name: Dr. Cola Inc. - DROLA

<tbody>
</tbody>
STAFFING ------Can Man - Joe Dirt
$92
$92
92

STAFFING ------Customer Service Rep - Tony Stark

<tbody>
</tbody>
$57
$57
57

STAFFING ------Customer Service Rep - Harry Toeknee

<tbody>
</tbody>
$100
$100
100

STAFFING ------Customer Service Rep - Tim Taylor

<tbody>
</tbody>
$10
$10
10

STAFFING ------Customer Service Rep - Alphabet Eddy

<tbody>
</tbody>
$1000
$1000
1000

STAFFING ------Customer Service Rep - Lawk Jaw

<tbody>
</tbody>
$9857
$9857
9857

STAFFING ------Customer Service Rep - Needa Lyfe

<tbody>
</tbody>
$8000
$8000
8000

STAFFING ------Customer Service Rep - Roger Rabbit

<tbody>
</tbody>
$600
$600
600

STAFFING ------Customer Service Rep - Didyuh Whin

<tbody>
</tbody>
$54
$54
54

STAFFING ------Customer Service Rep - Sally Shameful

<tbody>
</tbody>
$200
$200
200

STAFFING ------Customer Service Rep - Mie Mawm

<tbody>
</tbody>
$7
$7
7

Dr. Cola Inc. - DROLA Total

<tbody>
</tbody>
$19,977
$19,977
207
8054
1600
9857
102
157

<tbody>
</tbody>


Worksheet 3, I want it to give me these results


Client Name: Orange Bottom Jeans - ORJNS

<tbody>
</tbody>

STAFFING ------Temp - Rhine Peal

<tbody>
</tbody>
$564
$564
564

Orange Bottom Jeans - ORJNS Total

<tbody>
</tbody>
$564
$564
564

<tbody>
</tbody>

There has to be a way to *Find "ORJNS"* and then *list all rows/columns through "ORJNS Total"*....right?

I can provide the basic .xls if that helps.

I learned V-Lookup from you guys...you guys are awesome and I definitely appreciate all of your knowledge and desire to help. Thanks :)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
How about
Code:
Sub MoveClients()

   Dim Rng As Range
   Dim Ar As Areas
   Dim Sht As String
   
   With Range("A:A")
      .Replace "Client Name", "=xxxClient Name", xlPart, , False, , False, False
      Set Ar = .SpecialCells(xlConstants).Areas
      .Replace "=xxxClient Name", "Client Name", xlPart, , False, , False, False
   End With
   For Each Rng In Ar
      Sht = Rng.Offset(-1).Resize(1, 1).Value
      Sht = trim(Right(Sht, Len(Sht) - InStrRev(Sht, ":")))
      If Not Evaluate("isref('" & Sht & "'!A1)") Then
         Sheets.Add(, Sheets(Sheets.Count)).Name = Sht
      End If
      Rng.Offset(-1).Resize(Rng.Count + 1, 9).Copy Sheets(Sht).Range("A1")
   Next Rng
End Sub
If the client sheet doesn't exist, this will add it
 
Upvote 0
I posted something just now saying that the code above wasn't working...but I deleted a couple of rows that had irrelevant titles and that cleared up the error that I was referring to...so if it shows up (delayed)..please disregard.
 
Upvote 0

Forum statistics

Threads
1,215,373
Messages
6,124,562
Members
449,171
Latest member
jominadeo

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