Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Filter a column & Indent all but the 1st header record
Hello
I am filtering on column 1 6 times and than indenting column 3 a specific number of times depending on the criteria in column 1. Ex. If the criteria is 1 than I indent 2 times and ifthe criteria is I indent 4 times. I have supplied the code I am using below. It works fine except for indenting row 1 all the time. The issue is that I don't want row 1 ever indented and the way I have the code it is getting indented. How can I use the attached code and just not select row 1 on the indent.....as I want all rows it filtered to be indented except row 1. Thanks 'Filter on Column 1 the Outline level field and Indent Column 3 Task name Selection.AutoFilter Field:=1, Criteria1:="2" Range("C:C").Select Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.AutoFilter Field:=1, Criteria1:="3" Range("C:C").Select Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to Filter a column & Indent all but the 1st header record
Try
Selection.AutoFilter Field:=1, Criteria1:="2" Range("C2:C" & Range("C" & Rows.Count).End(xlUp).Row).Select Selection.InsertIndent 4 Selection.AutoFilter Field:=1, Criteria1:="3" Range("C2:C" & Range("C" & Rows.Count).End(xlUp).Row).Select Selection.InsertIndent 6 Hope this helps, Hutch "Bud" wrote: Hello I am filtering on column 1 6 times and than indenting column 3 a specific number of times depending on the criteria in column 1. Ex. If the criteria is 1 than I indent 2 times and ifthe criteria is I indent 4 times. I have supplied the code I am using below. It works fine except for indenting row 1 all the time. The issue is that I don't want row 1 ever indented and the way I have the code it is getting indented. How can I use the attached code and just not select row 1 on the indent.....as I want all rows it filtered to be indented except row 1. Thanks 'Filter on Column 1 the Outline level field and Indent Column 3 Task name Selection.AutoFilter Field:=1, Criteria1:="2" Range("C:C").Select Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.AutoFilter Field:=1, Criteria1:="3" Range("C:C").Select Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 Selection.InsertIndent 1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filter First Record | Excel Programming | |||
Filter text in a column by its Indent, to remove certain text | Excel Discussion (Misc queries) | |||
How do I indent a decimal aligned column from the margin? | Excel Discussion (Misc queries) | |||
record filter | Excel Programming | |||
Excel VBA - Best way to indent one column based on another | Excel Programming |