A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

AdvFilterRepFiltered.zip



 
 
Thread Tools Display Modes
  #1  
Old February 26th, 2007, 07:57 PM posted to microsoft.public.excel.newusers
sushil raina
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  
Old February 27th, 2007, 04:36 AM posted to microsoft.public.excel.newusers
Debra Dalgleish
external usenet poster
 
Posts: 1,998
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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:26 PM.


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