Advanced Filter

elgringo56

Well-known Member
Joined
Apr 15, 2002
Messages
869
When I do an Advanced Filter on a list with a copy to another location, the formats(color, font, etc.) of the cells which were filtered are also copied along with the data. Is there a way to prevent this as I only want the data.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
The problem with that, j844929, is that an advanced filter paste the data for you, you are not given a choice, not that I can see, anyway.
 
Upvote 0
What are you doing to copy the data to another location? Is it part of a vb script? If so, what is it?
 
Upvote 0
If you go to "Data", Advanced Filter, you will see that part of the criteria is to "copy to a different location" after filtering. This is a selectable option in the Advanced Filter. And, yes, I will be doing it in a macro, therefore, would like to figgure out if its possible to do it without the formats of the cells copying.
 
Upvote 0
elgringo56,

As far as I know when you use data/filter/advanced filter, and copy to another location, you have no choice but for the formats to come along. Perhaps someone could provide a piece of code to deal with this, but I always just select the copy to range after filtering and go to edit/clear/formats.

Good Luck.
 
Upvote 0
Yes, when doing the Filter manualy, I would do that, however, when doing from within a macro, in order to get rid of the formats, I have to have a macro to reformat the area copied to, which is a pain.
 
Upvote 0
Yes, when doing the Filter manualy, I would do that, however, when doing from within a macro, in order to get rid of the formats, I have to have a macro to reformat the area copied to, which is a pain.

Wouldn't these two lines placed in your code just after the advanced filter work?

Code:
Range("C1:C100").Select
Selection.ClearFormats

You only need to replace "C1:C100" with the range where you copied the data. It actually seems somewhat painless.
 
Upvote 0
Yes, that would do as a workaround, however, the question was, "is there a way to prevent the formats from copying?" I dont really like "work arounds" if it can be helped as sometime down the road, somone may have to debug something and they have to try and figgure out why a workaroud was used. In that respect, they are a pain.
 
Upvote 0
Understood.

Can you provide an example of the code you are using for the filter? I think that the only possibility will be another workaround (given your definition), but you never know.
 
Upvote 0

Forum statistics

Threads
1,214,635
Messages
6,120,660
Members
448,975
Latest member
sweeberry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top