VBA Advanced Filter unexpected result

vcto

New Member
Joined
Nov 10, 2011
Messages
4
I query a large database for errors between .301 and .31, class G. There are errors of class G+, which I don't need.

Criteria

A B C
2 Error Error Class
3 >.301 <.31 G


Code

Sub AdvFilter01()
Sheets("TestResults 2011-10").Range("A1:AR90000"). _
AdvancedFilter xlFilterCopy, _
Sheets("Filter01").Range("A2:C3"), _
Sheets("Filter01").Range("A6:B6")
End Sub

Output
A B
6 Error Class
7 0.303 G
8 0.302 G
9 0.304 G
10 0.306 G
11 0.302 G+
12 0.303 G+

Why am I getting G+?

Thank you,
vcto
 
Last edited:

Some videos you may like

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

pgc01

MrExcel MVP
Joined
Apr 25, 2006
Messages
19,884
Hi
Welcome to the board

If you specify

Class
G

This means you want strings starting with G.

If you just want the letter G then 3 options:

With the cell formatted as general use one of the 2

="=G"
or
'=G

or with the cell formatted as text use

=G
 

vcto

New Member
Joined
Nov 10, 2011
Messages
4
Hi PGC01,

I tried all 3 methods and they work. Thank you!
vcto
 

Watch MrExcel Video

Forum statistics

Threads
1,123,125
Messages
5,599,841
Members
414,342
Latest member
K Darrell Smith

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
Top