+ Reply to Thread
Results 1 to 9 of 9

Autofilter by mid(string)

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Exclamation Autofilter by mid(string)

    I have the below list which I am passing through a macro as a series of variables.

    Cork City RCMT
    Cork West & East RCMT
    Dublin Central RCMT
    Dublin North & West RCMT
    Dublin South RCMT
    Galway & Mayo RCMT
    Kerry & North Cork RCMT
    Limerick & Clare RCMT
    Mid Leinster RCMT
    North East RCMT
    North West RCMT
    South East RCMT
    Waterford & Tipperary RCMT

    I am populating files based on the autofilter results for 2 seperate columns matching each one of the above strings. However, as each of the strings vary in lenght I am unsure of the best way to get the string to match the auto filter results exactly.

    I've attached the below code to give an example of what I am doing. Any suggestions would be apreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Autofilter by mid(string)

    Sorry I forgot to point out its the second auto filter criteria in the "'Selects & copies data from dump file" piece of the code that is causing me trouble.

    Thanks in advance for your help!

  3. #3
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Autofilter by mid(string)

    what trouble is it causing you is it giving an error??
    why are you putting the ""??

  4. #4
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Autofilter by mid(string)

    Im trying afew differant solutions for this but appear to be haveing trouble with the synthax.

    This code runs ok but it doesnt appear to be pickung up from the Data Dump as I had hoped.

    Please Login or Register  to view this content.



    This code is returning a
    "Compile Error: Wrong number of arguments or invalid property assignment"

    highlighting "Left"

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Autofilter by mid(string)

    try this:
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Autofilter by mid(string)

    try this:
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Autofilter by mid(string)

    Im still getting the same compile error

  8. #8
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Autofilter by mid(string)

    sorry i didn't see that because in your previous code you were using Mid not left..
    Mid function accepts 3 arguments: the string, the starting position and the number for characters while Left accepts only the string and the number of characters so you either use :
    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Autofilter by mid(string)

    Ah good man, Thats the one!

    Your one of nature's gentlemen!

+ 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