Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Validation lost on advanced filter copy

I have code in a module that runs an advanced filter on a range of cells. One of
these columns has data validation linked to a list (named range). The data is
filtered no problem, but the cell with the data validation is cleared and only
the value is copied over. Is there an option that can be added to the advanced
filter code to allow the validation to transfer to the filtercopy range? Here is
the simple code I'm using.

Range("F1:F49").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"I3:I4"), CopyToRange:=Range("J4"), Unique:=True


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Validation lost on advanced filter copy

Andy,

Advanced filter copies only value to the CopyToRange - you would need to use
code like

Range("F2").Copy
Range(Range("J4"), Range("J65536").End(xlUp)).PasteSpecial Paste:=6

The 6 is Excel's way of indicating that it should paste data validation
only: the constant isn't defined, at least for XL2000, the version I run.

HTH,
Bernie
MS Excel MVP

"Andy" wrote in message
news:oE3jc.245819$Pk3.138192@pd7tw1no...
I have code in a module that runs an advanced filter on a range of cells.

One of
these columns has data validation linked to a list (named range). The

data is
filtered no problem, but the cell with the data validation is cleared and

only
the value is copied over. Is there an option that can be added to the

advanced
filter code to allow the validation to transfer to the filtercopy range?

Here is
the simple code I'm using.

Range("F1:F49").AdvancedFilter Action:=xlFilterCopy,

CriteriaRange:=Range( _
"I3:I4"), CopyToRange:=Range("J4"), Unique:=True




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, Copy to another location Tina Excel Worksheet Functions 6 June 5th 09 11:12 AM
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 09:28 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"