+ Reply to Thread
Results 1 to 2 of 2

VBA - If a value matches a text string then

  1. #1
    Registered User
    Join Date
    01-01-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010 (work) & 2013 (home)
    Posts
    45

    VBA - If a value matches a text string then

    Hi Guys,

    I have another problem today:

    I've got a rather lengthy process at the moment to look in the cell that shows a shift in the format "8.30am - 4.30pm" and then the formula eventually tells you how many hours have been worked in the shift written.

    I've approached this with a mixture of LEFT, RIGHT, LEN, FIND, SEARCH and ABS to get the end result.

    I've started to write a UDF for this process but I'm stuck trying to get it to do the following. I've written this in VB but it doesn't work as intended:

    Please Login or Register  to view this content.
    I'm not sure if you can use = for text strings; I guess not...

    Can anyone help?

    P.S. My VBA for this will probably be quite a lengthy bit of code as I'm a complete beginner - I would be looking to post my end result later on to see if anyone has any tips on improving etc.
    Last edited by elliotencore; 06-09-2013 at 02:53 PM.
    Elliot
    The geek shall inherit the earth

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: VBA Code

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

+ 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