+ Reply to Thread
Results 1 to 3 of 3

Get Number

  1. #1
    Registered User
    Join Date
    05-14-2008
    Posts
    27

    Question Get Number

    Hello,

    I have images which names are "img1", "img2", ..., "img10", ... "img36"

    So as you can see from "img1" to "img9" the names have only one number.
    From "img10" to "img36" the names have 2 numbers.

    I can't change this.

    I was getting the number as follows:
    Dim value As Integer
    value = Right(ImageName, 2).ToInteger

    But I get an error on the first cases.

    How can I solve this?

    Thanks.
    Miguel

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I think you can use Mid()

    =Mid(ImageName, 4)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    Please Login or Register  to view this content.
    Charlize

+ 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