PC Review


Reply
Thread Tools Rate Thread

AUTO FILTER WITH VALUE IN CELLS AND COPY FILTERED DATA TO NEW FILE

 
 
Eddy Stan
Guest
Posts: n/a
 
      21st Jun 2008
HI

CODE IN FOR AUTO FILTER & COPY TO NEW FILE

' FOR FIELD 2 "TPT" IS IN RANGE("B2").VALUE
' FOR FIELD 3 "WEST" IS IN RANGE("C2").VALUE
' FOR FIELD 4 "AURANGABAD BRANCH" IS IN RANGE("D2").VALUE

'Selection.AutoFilter Field:=2, Criteria1:="TPT"
'Selection.AutoFilter Field:=3, Criteria1:="WEST"
'Selection.AutoFilter Field:=4, Criteria1:="AURANGABAD BRANCH"
' WANT TO SAVE OUTFILE XLS AS AURANGABAD.XLS

ANY HELP URGENT. PLEASE
 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      22nd Jun 2008
On 21 Jun., 21:41, Eddy Stan <EddyS...@discussions.microsoft.com>
wrote:
> HI
>
> CODE IN FOR AUTO FILTER & COPY TO NEW FILE
>
> * * ' FOR FIELD 2 "TPT" IS IN RANGE("B2").VALUE
> * * ' FOR FIELD 3 "WEST" IS IN RANGE("C2").VALUE
> * * ' FOR FIELD 4 "AURANGABAD BRANCH" IS IN RANGE("D2").VALUE
>
> * * 'Selection.AutoFilter Field:=2, Criteria1:="TPT"
> * * 'Selection.AutoFilter Field:=3, Criteria1:="WEST"
> * * 'Selection.AutoFilter Field:=4, Criteria1:="AURANGABAD BRANCH"
> * * ' WANT TO SAVE OUTFILE XLS AS AURANGABAD.XLS
>
> ANY HELP URGENT. PLEASE


Hi

Dim wb As Workbook
Dim wb1 As Workbook

Set wb = ThisWorkbook
Set wb1 = Workbooks.Add
wb.Activate
Range("A110").Copy wb1.Sheets(1).Range("A1") ' Change Range to suit
sPath = "C:\Temp\" ' Change to suit
fName = "AURANGABAD.XLS"
wb1.SaveAs Filename:=sPath & fName

Regards,
Per
 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      22nd Jun 2008
see your other post and answer from Ron de Bruin

--

Regards,
Nigel
(E-Mail Removed)



"Eddy Stan" <(E-Mail Removed)> wrote in message
news:7D34E796-02DB-4705-BC9A-(E-Mail Removed)...
> HI
>
> CODE IN FOR AUTO FILTER & COPY TO NEW FILE
>
> ' FOR FIELD 2 "TPT" IS IN RANGE("B2").VALUE
> ' FOR FIELD 3 "WEST" IS IN RANGE("C2").VALUE
> ' FOR FIELD 4 "AURANGABAD BRANCH" IS IN RANGE("D2").VALUE
>
> 'Selection.AutoFilter Field:=2, Criteria1:="TPT"
> 'Selection.AutoFilter Field:=3, Criteria1:="WEST"
> 'Selection.AutoFilter Field:=4, Criteria1:="AURANGABAD BRANCH"
> ' WANT TO SAVE OUTFILE XLS AS AURANGABAD.XLS
>
> ANY HELP URGENT. PLEASE


 
Reply With Quote
 
Eddy Stan
Guest
Posts: n/a
 
      23rd Jun 2008
Hi
Can i use range name instead of absolute range


"Per Jessen" wrote:

> On 21 Jun., 21:41, Eddy Stan <EddyS...@discussions.microsoft.com>
> wrote:
> > HI
> >
> > CODE IN FOR AUTO FILTER & COPY TO NEW FILE
> >
> > ' FOR FIELD 2 "TPT" IS IN RANGE("B2").VALUE
> > ' FOR FIELD 3 "WEST" IS IN RANGE("C2").VALUE
> > ' FOR FIELD 4 "AURANGABAD BRANCH" IS IN RANGE("D2").VALUE
> >
> > 'Selection.AutoFilter Field:=2, Criteria1:="TPT"
> > 'Selection.AutoFilter Field:=3, Criteria1:="WEST"
> > 'Selection.AutoFilter Field:=4, Criteria1:="AURANGABAD BRANCH"
> > ' WANT TO SAVE OUTFILE XLS AS AURANGABAD.XLS
> >
> > ANY HELP URGENT. PLEASE

>
> Hi
>
> Dim wb As Workbook
> Dim wb1 As Workbook
>
> Set wb = ThisWorkbook
> Set wb1 = Workbooks.Add
> wb.Activate
> Range("A110").Copy wb1.Sheets(1).Range("A1") ' Change Range to suit
> sPath = "C:\Temp\" ' Change to suit
> fName = "AURANGABAD.XLS"
> wb1.SaveAs Filename:=sPath & fName
>
> Regards,
> Per
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you apply the auto filter to data that are filtered? Skip in FL Microsoft Excel Worksheet Functions 2 7th Jan 2009 02:56 AM
Copy and paste data from Auto Filter / Subtotal (or apply a formula to filtered data) Harry Flashman Microsoft Excel Discussion 7 9th Oct 2007 04:39 PM
Copy visible cells on Filtered data dairell@gmail.com Microsoft Excel Misc 4 18th Jul 2007 08:18 AM
Copy Auto-filtered data to new sheets =?Utf-8?B?Sk1heQ==?= Microsoft Excel Programming 6 2nd Jul 2007 06:28 PM
Copy auto filtered data edinclimb Microsoft Excel Misc 0 3rd Jan 2006 06:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:32 PM.