Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1
Default AdvFilterRepFiltered.zip

I found a very important file [http://www.contextures.
com/AdvFilterRepFiltered.zip]
at http://www.contextures.com/excelfiles.html#Filter by Debra Dalgleish.

Please help me with this:- I want to delete 'Column C' in all new worksheets
(these names are already in the new worksheet names) OR how can we generate
the new worksheets which do not contain 'Column C' i.e. only other Columns'
data gets copied and not the one according to which Filter is applied.

I will greatly appreciate if somebody can email me a modified excel file.

Thanks a lot.
Sushil Raina
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,979
Default AdvFilterRepFiltered.zip

You can change the code so it adds headings that don't include the
column C heading. Then use the headings as the extract range in the
code. The revised section for the example is:

'==================
For Each c In Range("J2:J" & r)
'add the rep name to the criteria area
ws1.Range("L2").Value = c.Value
'add new sheet (if required)
'and run advanced filter
If WksExists(c.Value) Then
Sheets(c.Value).Cells.Clear
ws1.Range("A1:B1,D1:G1").Copy Destination:=Sheets(c.Value).Range("A1")
rng.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Sheet1").Range("L1:L2"), _
CopyToRange:=Sheets(c.Value).Range("A1:F1"), _
Unique:=False
Else
Set wsNew = Sheets.Add
wsNew.Move After:=Worksheets(Worksheets.Count)
wsNew.Name = c.Value
ws1.Range("A1:B1,D1:G1").Copy Destination:=wsNew.Range("A1")
rng.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Sheet1").Range("L1:L2"), _
CopyToRange:=wsNew.Range("A1:F1"), _
Unique:=False
End If
Next
'==============

sushil raina wrote:
I found a very important file [http://www.contextures.
com/AdvFilterRepFiltered.zip]
at http://www.contextures.com/excelfiles.html#Filter by Debra Dalgleish.

Please help me with this:- I want to delete 'Column C' in all new worksheets
(these names are already in the new worksheet names) OR how can we generate
the new worksheets which do not contain 'Column C' i.e. only other Columns'
data gets copied and not the one according to which Filter is applied.

I will greatly appreciate if somebody can email me a modified excel file.

Thanks a lot.
Sushil Raina



--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

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



All times are GMT +1. The time now is 07:53 AM.

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"