Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bud Bud is offline
external usenet poster
 
Posts: 61
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default 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
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
Filter First Record Martin Excel Programming 0 June 26th 08 09:33 AM
Filter text in a column by its Indent, to remove certain text 99TZ250 Excel Discussion (Misc queries) 1 May 21st 06 08:53 AM
How do I indent a decimal aligned column from the margin? ChSp Excel Discussion (Misc queries) 1 December 1st 04 06:33 PM
record filter Ikke = Huub Excel Programming 3 July 1st 04 01:57 AM
Excel VBA - Best way to indent one column based on another wrkoch Excel Programming 2 May 30th 04 01:25 PM


All times are GMT +1. The time now is 10:24 PM.

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

About Us

"It's about Microsoft Excel"