Results 1 to 10 of 16

Thread: Looping Through String Using Excel VBA!

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    I used the delimiter to surround the string just to ensure we won't get a incorrect result when you search for a sub-string within the String. For example, if you don't use that delimiter, Instr(1,s1,"4",1) would give you 4 which is incorrect.
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  2. #2
    Junior Member
    Join Date
    Sep 2014
    Posts
    7
    Rep Power
    0
    Okay, thanks, Admin. I tested your Instr() function method and it also worked and ran almost as fast as the two For-loops method I was using. It was definitely faster than the dictionary data structure approach. Still playing around with variations of both to see if the execution time will be better.

Similar Threads

  1. Replies: 15
    Last Post: 08-23-2013, 12:03 PM
  2. VBA Looping Input Range and Output Range
    By Whitley in forum Excel Help
    Replies: 7
    Last Post: 04-25-2013, 09:02 PM
  3. Looping through Each Files and Folders
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 0
    Last Post: 04-18-2012, 12:12 AM
  4. Replies: 10
    Last Post: 04-07-2012, 05:33 AM
  5. Looping Through Each Internet Explorer
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 3
    Last Post: 03-27-2012, 07:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •