Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Filtering on String Length

in an adjacent column, but in the formula

M2: =len(B2)

Range("M2:M200").Formula = "=Len(B2)"

then apply your filter to column M.

--
Regards,
Tom Ogilvy


"Keith Wilby" wrote:

What VBA code would I need to set a filter based upon string length in a
cell, for example, if I wanted to filter column A for those entries 8
characters in length?

I found this in the help:

Worksheets("Sheet1").Range("A1").AutoFilter _
field:=1, _
Criteria1:="Otis"
VisibleDropDown:=False

but I don't know how adapt that for my needs. I guess I need to use the Len
function somewhere in there.

A little background - I am creating and formatting the spreadsheet from
within MS Access.

Many thanks.
Keith.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Filtering on String Length

"Tom Ogilvy" wrote in message
...
in an adjacent column, but in the formula

M2: =len(B2)

Range("M2:M200").Formula = "=Len(B2)"

then apply your filter to column M.


Spot on, working a treat. Thanks Tom.

Keith.

Reply
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
Zero-Length string vs Zero (also a valid value) [email protected] Excel Worksheet Functions 2 January 24th 09 02:18 PM
Finding a string of unknown length in a string of unknown length, Help! Hankjam[_2_] Excel Discussion (Misc queries) 8 July 3rd 08 06:49 PM
String length jxbeeman Excel Discussion (Misc queries) 1 January 10th 08 07:01 PM
string length Yan Robidoux[_10_] Excel Programming 3 August 19th 04 04:13 PM
Counting string length The Wonder Thing[_3_] Excel Programming 4 August 3rd 04 09:23 PM


All times are GMT +1. The time now is 10:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"