ARGK,
Thank you for that! It seems to work flawlessly. One benifit is this code will work on non-.xslm files. There would not be any need to enable macros.
Attached is a macro code one other guy in my office created me, in tandem with this posting.
Function SetIndent(r As Range, ByVal Level As Long) As Variant
' shg 2008
' Sets the indent level of r from 0 to 15 and returns the indent level
Dim cell As Range
SetIndent = IIf(Level < 0, "Min is 0!", IIf(Level > 15, "Max is 15!", Level))
If Level < 0 Then Level = 0 Else If Level > 15 Then Level = 15
For Each cell In r
With cell
If Level - .IndentLevel Then .InsertIndent Level - .IndentLevel
End With
Next cell
End Function
Bookmarks