+ Reply to Thread
Results 1 to 3 of 3

Extracting strings from Sub-name

  1. #1
    Registered User
    Join Date
    12-13-2012
    Location
    Hamburg
    MS-Off Ver
    Excel 2010
    Posts
    13

    Extracting strings from Sub-name

    Hey VBA-experts,

    I have 144 pictures sorted in a matrix (6 by 24) on a User Form. I named theses pictures systematically so I can identify them easily based on their location. What I want to realize is, that if a picture is clicked on a function should be called, in which the image name should be used as parameter. However if I do that for each picture there is quite some manual work.

    In the code you can see the example for Image4_2. From the name of the Image I would like to extract the two numbers and assign them to the row and seat variables. Is there a way to realize that? I tried the Me command, but that only refered to the Form itself instead to the image.

    Thanks a lot for your help and time in advance.
    Have a good day,
    Konfis

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    11-26-2012
    Location
    Kitchener, Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Extracting strings from Sub-name

    Hi knofis,

    I don't see problem using Me command. You got it right ie "Me.Controls(ImgStr).ControlTipText =" nothing wrong with it.
    aelgadi

    > Click Star if I helped. Thanks

  3. #3
    Registered User
    Join Date
    12-13-2012
    Location
    Hamburg
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Extracting strings from Sub-name

    Hey aelgadi,

    thanks for the quick response. Probably I wasnt clear enough:
    In the example above I had to assign 4 and 2 manually to the variables row and seat. I am looking for a command that allows me to use the subname ("Image4_2_MouseMove") and extract from there the 4 and 2 and assign them to the variables row and seat.
    Please let me know if it needs more clarification.

    Thanks a lot again,
    Konfis

+ 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