+ Reply to Thread
Results 1 to 3 of 3

A way in Excel to select permutation data only allowing for certain type of sequence?

Hybrid View

  1. #1
    Registered User
    Join Date
    05-14-2010
    Location
    Bethesda MD
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question A way in Excel to select permutation data only allowing for certain type of sequence?

    I have created an excel doc with every known permutation of the randomly assigned characters S, F, O, P and S', F',O', P' but only wish to look at permutations that turned out looking like this: SS'FP'O wherein the letters with " ' " are separated from each other by regular letters. Can I make excel select for specific place orders and not specific data sets?

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: A way in Excel to select permutation data only allowing for certain type of seque

    Hi cchelise
    Try this ....
    Option Explicit
    Sub test()
    Dim oRgx As Object, rCell As Range
    Set oRgx = CreateObject("VBScript.RegExp")
    With oRgx
        .IgnoreCase = True
        .Global = True
        .Pattern = "\w{2}\W\w{2}\W\w"
        For Each rCell In Range("A2:A10")
           If .test(rCell.Value) = True Then
            rCell.Font.Color = vbRed
          End If
        Next rCell
    End With
    End Sub
    Last edited by pike; 05-14-2010 at 06:25 PM.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: A way in Excel to select permutation data only allowing for certain type of seque

    or this pattern
    .Pattern = "^[SFOP]{2}['][SFPO]{2}['][SFOP]$"
    Last edited by pike; 05-15-2010 at 08:05 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1