+ Reply to Thread
Results 1 to 4 of 4

Looking for an equivalent of RIGHT function in VBA

  1. #1
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    Looking for an equivalent of RIGHT function in VBA

    I am using vCriteria to create a scripting dictionary, but rather than the criteria being based on a the entire contents of a cell I would like to use an equivalent of the RIGHT function.

    So at the moment my criteria is for the entire contents of cell D5:

    vCriteria = Sheets("Sheet1").Range("D5").Value2


    But I don't want to use all of the contents I would like excel to not include the last four characters as part of the criteria, i.e. an equivalent of =RIGHT(D5,4)

    Is this possible in VBA?

    Thanks in advance

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Looking for an equivalent of RIGHT function in VBA

    VBA does have a similar function, I think it's called Right.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Looking for an equivalent of RIGHT function in VBA

    your description and suggested formula are confusing.

    You say NOT include, where as the RIGHT function would ONLY include last four characters.
    I would like excel to not include the last four characters

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Contributor
    Join Date
    04-19-2013
    Location
    Yorkshire, England
    MS-Off Ver
    Excel 2010
    Posts
    297

    Re: Looking for an equivalent of RIGHT function in VBA

    oh well I meant to put include, sorry about that just a bit of a slip up

    thanks for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Access Equivalent of this Excel VBA Function?
    By mccrimmon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2012, 06:34 AM
  2. maxif equivalent function
    By kamelkid2 in forum Excel General
    Replies: 4
    Last Post: 06-20-2011, 09:47 AM
  3. vba equivalent of SQL's IN function?
    By larbadar in forum Excel General
    Replies: 5
    Last Post: 07-24-2010, 06:16 PM
  4. [SOLVED] VBA Equivalent of FIND or SEARCH Function
    By Magnivy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2006, 01:50 PM
  5. [SOLVED] VBA equivalent for SQL 'IN' function
    By Mitch in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2006, 07:15 PM

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