+ Reply to Thread
Results 1 to 2 of 2

Extract number from a ListBox string value

  1. #1
    Forum Contributor
    Join Date
    04-13-2006
    Location
    London
    Posts
    102

    Question Extract number from a ListBox string value

    This should be easy for me, but I'm having a mental block.

    I have a userform list, with the list value as follows:

    134 Fred Bloggs, London

    I want to assign the number at the beginning of the list value to a long variable, lNumber. The command I came up with is as follows, but it is not working:

    lNumber = val(left(ListBox1.value, Application.WorksheetFunction.Find(" ", ListBox1.value)-1))

    Can anyone tell me where I'm going wrong please?

    Thanks!

  2. #2
    Forum Contributor
    Join Date
    04-13-2006
    Location
    London
    Posts
    102
    It's OK - I've worked it out!

    It was a problem I had elsewhere in the spreadsheet - the command is fine!

+ 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