Grouping by Indent using VBA

KelMich65

New Member
Joined
Oct 3, 2016
Messages
1
Goal: To use a macro to group my data based on the detail information being indented.

I have the following in Column A of a worksheet:

Item description
detail
detail
detail
Item description
detail
detail
detail
detail
detail
detail

Variables:
  • The number of Item descriptions from one worksheet to the next
  • The number of detail lines below each Item description even on the same worksheet

Constants:
  • The first Item description is always in cell A3
  • The Item description always starts with a 10- or 11-digit number followed by text
  • There is always data in columns A-I, but determining the grouping is only based on what is in column A
  • The amount the "detail" is indented is always the same
  • There is only one level of indention
  • The detail is always below the Item description so "summary rows below detail" will need to be turned off
  • I am using Excel 2013

I've seen some macros that do things similar, but they don't match my scenario exactly, and I've been unable tweak them to get them to work for me.

This is my first post ever so if I didn't provide all the information needed, or if it isn't clear, please guide me as to what I need to change/improve.

All help is appreciated!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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