Identifying variable range and running formula in corresponding number of rows

skull_eagle

Board Regular
Joined
Mar 25, 2011
Messages
89
Hi All,

I have what I consider to be an advanced problem.
I need a code that will scroll through column A and identify ranges of matching names, it may be just 2 rows or 100 rows
Once 2 or more rows have been identified I need it to insert a new row and compress the data Column A = Name, Column B = Date Range, Column C = Date Range, Column D = Count (there is more than this but this is an example. Then group and hide the range of matching rows and continue on to find the next range.

I'm unsure how to make the code identify matching rows and once the rows are identified how to offset the cell but for it to still remember how many rows it identified in column A.

eg. If 3 rows in Column A are identified as matching then I need the date range formula set in column B set over 3 rows, if 20 rows are identified then it would need to be over 20 rows etc.

Code:
[RANGE=cls:xl2bb-100][XR][XH=cs:5]Excel Workbook[/XH][/XR][XR][XH][/XH][XH]A[/XH][XH]B[/XH][XH]C[/XH][XH]D[/XH][/XR][XR][XH]1[/XH][XD=h:l]BRAD VERYAN[/XD][XD=h:l]6/08/1997[/XD][XD=h:l]5/22/2000[/XD][XD]2011024[/XD][/XR][XR][XH]2[/XH][XD=h:l]BRAD VERYAN[/XD][XD=h:l]6/30/1994[/XD][XD=h:l]5/22/2000[/XD][XD]2011040[/XD][/XR][XR][XH]3[/XH][XD=h:l]BRAD VERYAN[/XD][XD=h:l]6/08/1997[/XD][XD=h:l]5/25/2000[/XD][XD]2011041[/XD][/XR][XR][XH]4[/XH][XD=h:l]CHADWICK AGENCY PTY LIMITED[/XD][XD=h:l]1/17/1995[/XD][XD=h:l]5/22/2000[/XD][XD]2011024[/XD][/XR][XR][XH]5[/XH][XD=h:l]GRAHAM CLIFF[/XD][XD=h:l]9/07/1997[/XD][XD=h:l]6/29/2000[/XD][XD]2011089[/XD][/XR][XR][XH]6[/XH][XD=h:l]GRAHAM CLIFF[/XD][XD=h:l]1/28/1998[/XD][XD=h:l]6/29/2000[/XD][XD]2011097[/XD][/XR][XR][XH]7[/XH][XD=h:l]STRATA MANAGEMENT PTY LIMITED[/XD][XD=h:l]8/31/1993[/XD][XD=h:l]5/25/2000[/XD][XD]2011040[/XD][/XR][XR][XH]8[/XH][XD=h:l]MARSH MARGARET[/XD][XD=h:l]1/01/1995[/XD][XD=h:l]3/02/2000[/XD][XD]2010991[/XD][/XR][XR][XH=cs:5][RANGE][XR][XD]Sheet2[/XD][XH][/XH][/XR][/RANGE][/XH][/XR][/RANGE][B]Excel 2010[/B]

Should be converted to

Code:
[RANGE=cls:xl2bb-100][XR][XH=cs:5]Excel Workbook[/XH][/XR][XR][XH][/XH][XH]A[/XH][XH]B[/XH][XH]C[/XH][XH]D[/XH][/XR][XR][XH]4[/XH][XD=h:l]BRAD VERYAN[/XD][XD=h:l]1994 - 1997[/XD][XD]2000[/XD][XD]3[/XD][/XR][XR][XH]5[/XH][XD=h:l]CHADWICK AGENCY PTY LIMITED[/XD][XD=h:l]1/17/1995[/XD][XD=h:l]5/22/2000[/XD][XD]2011024[/XD][/XR][XR][XH]8[/XH][XD=h:l]GRAHAM CLIFF[/XD][XD=h:l]1997 - 1998[/XD][XD]2000[/XD][XD]2[/XD][/XR][XR][XH]9[/XH][XD=h:l]STRATA MANAGEMENT PTY LIMITED[/XD][XD=h:l]8/31/1993[/XD][XD=h:l]5/25/2000[/XD][XD]2011040[/XD][/XR][XR][XH]10[/XH][XD=h:l]MARSH MARGARET[/XD][XD=h:l]1/01/1995[/XD][XD=h:l]3/02/2000[/XD][XD]2010991[/XD][/XR][XR][XH=cs:5][RANGE][XR][XD]Sheet3[/XD][XH][/XH][/XR][/RANGE][/XH][/XR][/RANGE][B]Excel 2010[/B][RANGE=cls:xl2bb-extra-100][XR][XH=cs:2]Cell Formulas[/XH][/XR][XR][XD]Cell[/XD][XD]Formula[/XD][/XR][XR][XD]A4[/XD][XD]=A1[/XD][/XR][XR][XD]A8[/XD][XD]=A7[/XD][/XR][/RANGE]

Any help would be extremely appreciated.

Cheers
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,224,585
Messages
6,179,704
Members
452,938
Latest member
babeneker

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