gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,347
- Office Version
- 365
- Platform
- Windows
Run0time error 1004 : Unable to set Indentlevel property of the range class
Someone kindly gave me this code and I am trying to use it in a new spreadsheet. it does indent the rows but them it debugs with the message above. Anyone know why?
Someone kindly gave me this code and I am trying to use it in a new spreadsheet. it does indent the rows but them it debugs with the message above. Anyone know why?
Code:
Sub Indent()
'
Dim Ind As Range
'
'this is where the Level is listed
For Each Ind In Range("C9", Range("C" & Rows.Count).End(xlUp))
'these are which rows to indent
Union(Ind.Offset(, -1), Ind.Offset(, 2)).IndentLevel = Ind.Value
'
Next Ind
'
End Sub