LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Autofilter - formatting criteria1 data for valid comparison

2003

Procedure obtains a numeric value (NumbToReplace) from an input box.

The typical worksheet column format is:
NumberFormat = "#,##0.00_);(#,##0.00)" 'Number with 2 Dec Places

But the same column on other worksheets have format of:
NumberFormat = "#,##0.00000_);(#,##0.00000)" 'Number with 5

I format NumbToReplace as follows:
FilterCriteria = WorksheetFunction.Text(NumbToReplace, _
"#,##0.00_);(#,##0.00)")

Then I set the filter:
Filter1.AutoFilter Field:=4, Criteria1:="=" & FilterCriteria

The challenge: How to format "NumbToReplace" which becomes
"FilterCriteria" so that the filter is set properly no matter how many
decimal places the worksheet column has?

I am having a can't-see-the-forest-for-the-trees-moment even though the
answer is probably staring me right in the face..

TIA EagleOne

 
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
Conditional formatting to highlight the lowest valid value PaladinWhite Excel Worksheet Functions 1 March 25th 08 11:35 PM
can I use a cell content as a Criteria1 reference in the below Selection.AutoFilter statement? prady Excel Programming 1 July 28th 06 04:27 PM
Pivot Table not valid error message when formatting data 'button'. MDW Excel Discussion (Misc queries) 0 January 27th 05 03:01 PM
for...next and criteria1 jafeol Excel Programming 1 June 6th 04 09:12 PM
Auto Filter and Criteria1 variable D.S.[_3_] Excel Programming 2 November 18th 03 04:16 AM


All times are GMT +1. The time now is 04:53 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"