+ Reply to Thread
Results 1 to 5 of 5

Block use of special characters /\:*?"<>

  1. #1
    Registered User
    Join Date
    08-11-2019
    Location
    USA
    MS-Off Ver
    365
    Posts
    43

    Block use of special characters /\:*?"<>

    Hello all.
    I have a macro that when you run it, it saves the Excel file in a specific location.
    The file name is taken from a specific cell that is filled by the user before running the macro.

    The problem is, when the user insert specific characters in that cell, it stops the macro.
    The characters are /\:*?"<> ... All the characters that are not acceptable in Excel file names.

    My question is if there is a way to block the use of these characters inside cells?

    Thanks in advance.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,830

    Re: Block use of special characters /\:*?"<>

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Change the range (in red) to the suit your needs. Close the code window to return to your sheet. Enter a value in A1 and press the RETURN key.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Block use of special characters /\:*?"<>

    I located a dialogue which inspects the worksheet for illegal characters, and fixes them before the macro runs. You might load it use a call() before your macro and it should flow.

    https://www.excelcise.org/vba-functi...ers-in-string/

    Pete

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Block use of special characters /\:*?"<>

    Lots of topics on this, here's one.

    https://www.excelforum.com/excel-pro...s-or-name.html

  5. #5
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    487

    Re: Block use of special characters /\:*?"<>

    Hi,
    macro for multi-cell

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. [SOLVED] Substitute formula - i want to replace cell containing special characters "??????*"
    By karthikskengeri in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-14-2013, 06:21 AM
  2. Replies: 4
    Last Post: 11-17-2012, 04:42 AM
  3. Macro to replace European characters with non "special" English characters?
    By johanna0507 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 09:13 AM
  4. SUBSTITUE all special characters to "_"
    By dan4ish in forum Excel General
    Replies: 1
    Last Post: 04-11-2012, 05:38 AM
  5. Block and fill cell characters
    By implacabilemastino in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-21-2011, 08:42 AM
  6. Error msgs: "Object varible or with block variable not set"; "subscript out of range"
    By menyanthe in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2009, 04:58 PM
  7. Replies: 3
    Last Post: 07-17-2006, 02:20 PM
  8. [SOLVED] test for "special characters" in text
    By Frank Cutre in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-20-2005, 11:50 PM

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