#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Indent

What formula can I use to display the number of spaces indented if the user
user formatcellsindent (not the spacebar)?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Indent

Can you work with this?

Dim lngRow As Long
Dim intCIL As Integer
Dim intPIL As Integer
For lngRow = 1 To Cells(Rows.Count, "B").End(xlUp).Row
intCIL = Range("B" & lngRow).IndentLevel
If intCIL 0 Then
If intCIL intPIL Then
arrINT(intCIL) = lngRow
ElseIf intCIL < intPIL Then
GroupRows2 intCIL, lngRow
End If
intPIL = intCIL
End If
Next lngRow
GroupRows2 1, lngRow
ActiveSheet.Outline.ShowLevels RowLevels:=1

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Indent" wrote:

What formula can I use to display the number of spaces indented if the user
user formatcellsindent (not the spacebar)?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Indent

Whoops, didn't copy the whole thing. This is all of it...with a small sub to
ungroup the results.

Dim arrINT(10) As Long
Sub GroupbyIndexLevels2()
Dim lngRow As Long
Dim intCIL As Integer
Dim intPIL As Integer
For lngRow = 1 To Cells(Rows.Count, "B").End(xlUp).Row
intCIL = Range("B" & lngRow).IndentLevel
If intCIL 0 Then
If intCIL intPIL Then
arrINT(intCIL) = lngRow
ElseIf intCIL < intPIL Then
GroupRows2 intCIL, lngRow
End If
intPIL = intCIL
End If
Next lngRow
GroupRows2 1, lngRow
ActiveSheet.Outline.ShowLevels RowLevels:=1
End Sub

Sub GroupRows2(intIND As Integer, lngRow As Long)
Dim intTemp As Integer
For intTemp = intIND + 1 To UBound(arrINT)
If arrINT(intTemp) < 0 Then
Rows(arrINT(intTemp) & ":" & lngRow - 1).Group
arrINT(intTemp) = 0
End If
Next
End Sub


Sub UnGrp()
Range("A1").Select
Selection.ClearOutline
End Sub

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Indent" wrote:

What formula can I use to display the number of spaces indented if the user
user formatcellsindent (not the spacebar)?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Indent size Learner101b Excel Discussion (Misc queries) 6 February 10th 08 06:06 PM
bullet in excell with indent zap Excel Worksheet Functions 1 September 13th 06 01:15 PM
shortcut for indent BorisS Excel Discussion (Misc queries) 2 November 10th 05 12:37 AM
Indent within a row marilyn Excel Worksheet Functions 3 May 5th 05 05:50 PM
indent size? [email protected] Excel Discussion (Misc queries) 1 January 26th 05 11:27 AM


All times are GMT +1. The time now is 06:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"