Formula to find Format (Alignment/Indent Level)

AndrewBT

New Member
Joined
Aug 30, 2005
Messages
14
Hi all

I have some structured data which uses indentations to display a hierarchy (in the "Format Cells" dialog under "Alignment" there is a box "Indent" which shows the indent/hierarchy level). I'm trying to pull out this indent level without success and hope someone may have some ideas.

I looked at using Get.Cell (http://www.mrexcel.com/forum/showthread.php?t=20611) but indent level doesn't seem to be an option. I tried using 53 to get contents as displayed including formatting but it doesn't include any leading spaces/tabs.

Can anyone help?

Thanks

Andrew
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Create a user defined funtion

Function indenture(r As Range) As Integer
indenture = r.IndentLevel
End Function

A1 is the cell for which you want to check the indent
=indenture(A1) will return a 3
 
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,629
Members
449,241
Latest member
NoniJ

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