Consulting

Page 3 of 3 FirstFirst 1 2 3
Results 41 to 51 of 51

Thread: verify start and end tags

  1. #41
    VBAX Expert
    Joined
    Jul 2004
    Location
    Wilmington, DE
    Posts
    600
    Location
    Hey all, please check out my post in:
    http://vbaexpress.com/forum/showthread.php?t=6956

    I think you'll like it

    Patrick

  2. #42
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    348
    Location
    that would be nice
    thnx for all your help

  3. #43
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Here's something to try. It contains your sample as posted.
    Running Patrick's "CheckTags" code will identify any mismatched items.
    Running my Tags code will identify an extra bracket. Delete this and rerun the code.
    This should highlight the end of an open/close which contains an error; in this case an opening Amjust with no \Amjust.

    BTW Gerry, I tried to incorporate your neat CountOfWords, but had problems with a search for <*>, so for now, I'm using my clumsy xx*zz alternative.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #44
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    348
    Location
    ok i will try and let you know

  5. #45
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    348
    Location
    if i understand this right first your sub identify any extra bracket, then when i delete extra bracket and rerun your sub it will locate any missing or damaged tags and higlight them with yellow

    Am I correct
    thnx for all your time

  6. #46
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    A extra bracket may not be the error, it could be a missing bracket. The code identifies a problem, not the solution. In your sample, it appears there is one extraneous extra bracket.

    With regard to tags, the code should identify the location of an error, but not necssarily the error itself. The attached Excel version may assist in the debugging of any errors.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  7. #47
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    348
    Location
    can you pliz explain how this works if i add or delete bracket there is no data in excel sheet or if i damage or delete some tag also there are no data in debug.xls
    why

    thnx

  8. #48
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    I don't think I can give you an "all encompassing" solution. There are too many potential variables. My code in post 46 is supplementary to that in Post 43. I've assumed that bracket errors are corrected before running the Excel code, and Patrick's code will highlight any missing tag terms.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  9. #49
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    348
    Location
    but patricks code does not higlight any missing term it just count them and give me msgbox with asterisks where tag is missing or damaged

  10. #50
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    By "highlight" I mean it lets you know what to look for. The codes provided should assist in your debugging, but a full blown solution is beyond my limits as a helper here. Perhaps you need to commission someone to create a "professional" solution.
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  11. #51
    VBAX Mentor
    Joined
    Jan 2006
    Posts
    348
    Location
    man thnx for all your help i really appreciate it

    thnx to all of you
    saban

Posting Permissions

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