+ Reply to Thread
Results 1 to 5 of 5

Save Macro - Avoid errors when /'s are present

  1. #1
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Save Macro - Avoid errors when /'s are present

    I have a save macro that saves the file and uses a value in a cell for the filename. Sometimes this value may have a / in it.

    How can I modify this to prevent error? The solution I thought of is to have another cell = this particular cell and replace /'s with spaces...and then use that value for saving instead..but there may be an in vba code solution I am not aware of.

    Please Login or Register  to view this content.
    For reference C11 and C30 are part numbers that are generally numbers with dashes, but occasionally have a / in them which is what of course throws the error.

    Thanks in advance, also, Happy Thanksgiving (I know it's over now but still)

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,528

    Re: Save Macro - Avoid errors when /'s are present

    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Re: Save Macro - Avoid errors when /'s are present

    That simple.... I am dumb.

    Thank you.

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,528

    Re: Save Macro - Avoid errors when /'s are present

    Not at all...just needed a fresh set of eyes...
    Tx for rep +

  5. #5
    Forum Contributor NewYears1978's Avatar
    Join Date
    03-15-2010
    Location
    Forney, TX
    MS-Off Ver
    Excel 2016
    Posts
    962

    Re: Save Macro - Avoid errors when /'s are present

    Quote Originally Posted by sintek View Post
    Not at all...just needed a fresh set of eyes...
    Tx for rep +
    Haha right on. My eyes are not fresh after Thanksgiving..was a busy one and not much sleep! Works perfect thanks again and you're welcome

+ 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] Search through all worksheets in a workbook, present the results and avoid duplicates
    By ThiaJay in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 08-21-2020, 05:00 AM
  2. [SOLVED] Avoid Errors when running macro buttons simultaneously
    By KassimVBA7 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-15-2015, 10:26 AM
  3. Validating whether a code is already present in a spreadsheet to avoid duplications.
    By aleisure in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2015, 04:58 PM
  4. Save VBA errors & report them after macro completes
    By Philb1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2013, 01:00 AM
  5. Dealing with errors in file save macro
    By tcombest in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2012, 02:43 PM
  6. Save small 15x42 pixel two tone image in macro to avoid external file
    By NumberOCD in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2011, 11:03 AM
  7. How to avoid an error, if you press cancel on a SAVE FILE-Macro
    By Silas313 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-01-2010, 04:56 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