+ Reply to Thread
Results 1 to 4 of 4

VBA - Escape characters for square bracket

  1. #1
    Registered User
    Join Date
    03-20-2018
    Location
    Singapore
    MS-Off Ver
    Office 365 Excel 2016
    Posts
    68

    Lightbulb VBA - Escape characters for square bracket

    Hi, I am looking for a list of escape characters to denote special characters in strings

    For example, the double quote escape character is "" if you want to put literally double quotes in the string

    In particular, I am looking for the escape character for square brackets [ and ]

    Any help?

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: VBA - Escape characters for square bracket


    Hi,

    as square brackets do not need to be escaped in a VBA String variable …

    When it's for some operator the escape character is often the tilde aka ~ …
    Last edited by Marc L; 04-09-2020 at 11:27 AM.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: VBA - Escape characters for square bracket

    Hi,

    Here is the list of escape characters for lots of languages.
    http://www.codecodex.com/wiki/Escape..._characters#VB
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: VBA - Escape characters for square bracket

    If used with Like operator, you need to enclose as a character set like,

    [[] for [
    []] for ]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA:SEARCH problem with square bracket []
    By Pongwipat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2015, 06:00 AM
  2. [SOLVED] Run-time error 1004 The formula is not complete. Make sure an ending square bracket ]
    By triaji in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-30-2014, 12:13 AM
  3. Replies: 2
    Last Post: 07-18-2014, 03:00 AM
  4. Replies: 0
    Last Post: 06-04-2013, 10:01 PM
  5. Merging between escape characters
    By Peleus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-08-2011, 10:00 AM
  6. Remove String Within the Bracket and also the Bracket
    By seanyeap in forum Excel General
    Replies: 6
    Last Post: 04-23-2010, 10:24 AM
  7. [SOLVED] Search for Square Characters
    By BCBC in forum Excel General
    Replies: 6
    Last Post: 12-29-2005, 11:45 AM

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