Macro Help

michael_allen_24

Board Regular
Joined
Dec 29, 2010
Messages
64
Hello,

I was wondering if any could point me in the right direction. I have a Macro that I have been using for a while that when I run it, it looks through my auto filter and pulls back the corresponding values. I have always used names in this formula. I am now trying to pull back numbers such as 10734624. When I adjust the AutoFilter field and run the macro with the numbers, it doesn't pull anything back. Why is that? Thanks.

Formula I am using for my Macro:

Range("E6:AE2496").AutoFilter Field:=2, Criteria1:=Application.Transpose(Range("C7:C66").Value), Operator:=xlFilterValues</SPAN>
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hello,

I was wondering if any could point me in the right direction. I have a Macro that I have been using for a while that when I run it, it looks through my auto filter and pulls back the corresponding values. I have always used names in this formula. I am now trying to pull back numbers such as 10734624. When I adjust the AutoFilter field and run the macro with the numbers, it doesn't pull anything back. Why is that? Thanks.

Formula I am using for my Macro:

Range("E6:AE2496").AutoFilter Field:=2, Criteria1:=Application.Transpose(Range("C7:C66").Value), Operator:=xlFilterValues</SPAN>

It probably doesn't know what to do with the array you created for Criteria1. I don't know that it will allow more than a single value to be used for Criteria.
 
Upvote 0
Something I didn't know! The help file specifically says Criteria as a string, then show "101" as an example. But it would probably throw an error if you tried to use CStr like CStr(Application.Transpose(Range("C7:C66").Value). Maybe you could format the column or range as text.
 
Upvote 0

Forum statistics

Threads
1,203,172
Messages
6,053,905
Members
444,694
Latest member
JacquiDaly

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