PDA

View Full Version : Filtering With VBA Macro



mattster1010
10-22-2010, 04:11 AM
Afternoon,

I have uploaded an example workbook that I want to filter the column 'Bill Frequancy' with some vba. I need to filter any bill frequancy between 02 and 10. I've tried using the autofilter but this always returns incorrect results.

Can anyone help.

Regards,

Mattster

p45cal
10-22-2010, 06:37 AM
It may not need a macro. The data in column C is 'numbers stored as text'. You can quickly convert them to proper numbers by putting the number 1 in say E1, copy it, then select C2:C27, Edit|PasteSpecial|Multiply|OK. Then delete E1.
Now your autofilter should work.

p45cal
10-22-2010, 07:01 AM
Another way of converting them to numbers: If you have your Tools|Options|Error checking|Number stored as text checkbox ticked, when you select C2:C27, you'll see a small box with an exclamation mark which you can click, choose Convert to number. Job done.