#1   Report Post  
Junior Member
 
Posts: 11
Default Advanced Filter Help

Dear Professors

Sheet1 has following Five columns

-A------B--------C---------D--------E----------F-----
code--country--capital--language--president--currency
--1----India----Delhi----Hindi-----Kalam-----Rupee
--2----Iraq----Bugdad----Arabic-----Jalal-----Riyal
--3----Iran---Thehran---Persian----Mehmood----Dirham

Oval1 on sheet1 has following codee

[vba]
Sub Oval1_Click()

Range("A3:F7").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("a5"), CopyToRange:=Range("Print!A3"), Unique:=False
Sheets("Print").Select

Range("A1").Select
End Sub
[/vba]

Above codes work fine and copy all data to sheets("Print")

My Question is:

How to copy only following columns to sheets("PRINT")?

column A, column B, column D, column F

After Runing MACRO sheets("PRINT") must look like this


code--country---language---currency
--1----India-----Hindi------Rupee
--2----Iraq-----Arabic------Riyal
--3----Iran----Persian-----Dirham


Please help and modify above codes
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Advanced Filter Help

Record a macro when you filter in place, then copy just those columns that you
want.

Or...

filter and copy to the new location, then delete the columns you don't want.

tqm1 wrote:

Dear Professors

Sheet1 has following Five columns

-A------B--------C---------D--------E----------F-----
code--country--capital--language--president--currency
--1----India----Delhi----Hindi-----Kalam-----Rupee
--2----Iraq----Bugdad----Arabic-----Jalal-----Riyal
--3----Iran---Thehran---Persian----Mehmood----Dirham

Oval1 on sheet1 has following codee

Sub Oval1_Click()

Range("A3:F7").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("a5"), CopyToRange:=Range("Print!A3"),
Unique:=False
Sheets("Print").Select

Range("A1").Select
End Sub

Above codes work fine and copy all data to sheets("Print")

My Question is:

How to copy only following columns to sheets("PRINT")?

column A, column B, column D, column F

After Runing MACRO sheets("PRINT") must look like this

code--country---language---currency
--1----India-----Hindi------Rupee
--2----Iraq-----Arabic------Riyal
--3----Iran----Persian-----Dirham

Please help and modify above codes

--
tqm1


--

Dave Peterson
  #3   Report Post  
Junior Member
 
Posts: 11
Default

Quote:
Originally Posted by Dave Peterson View Post
Record a macro when you filter in place, then copy just those columns that you
want.

Or...

filter and copy to the new location, then delete the columns you don't want.

Dave Peterson

It will be better not not to copy unneeded columns to new location.
But how to copy some columns from a range?

Please help
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Advanced Filter Help

Turn on the macro recorder when you do it manually. You'll see the code.

tqm1 wrote:

Dave Peterson;514444 Wrote:
Record a macro when you filter in place, then copy just those columns
that you
want.

Or...

filter and copy to the new location, then delete the columns you don't
want.

Dave Peterson


It will be better not not to copy unneeded columns to new location.
But how to copy some columns from a range?

Please help

--
tqm1


--

Dave Peterson
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
Advanced Filter - filter rows < jaws4518 Excel Discussion (Misc queries) 3 November 1st 06 05:48 PM
Why won't advanced filter return filter results? jaws4518 Excel Worksheet Functions 5 September 12th 06 06:11 PM
How do I use advanced filter to filter for blank cells? Monique Excel Discussion (Misc queries) 2 March 21st 06 06:43 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM
advanced filter won't allow me to filter on bracketed text (-456.2 LucianoG Excel Discussion (Misc queries) 1 December 6th 04 08:38 PM


All times are GMT +1. The time now is 10:19 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"