+ Reply to Thread
Results 1 to 4 of 4

Vba replacing all occurrences of "-" in a sheet

  1. #1
    Registered User
    Join Date
    02-18-2020
    Location
    London
    MS-Off Ver
    2010
    Posts
    75

    Vba replacing all occurrences of "-" in a sheet

    Hello

    I would like my vba code to replace all occurences of the minus "-" sign in a sheet. The sheet contains only data and no formulas.

    The following command works for regular data but does not find the "-" sign:

    Please Login or Register  to view this content.
    Perhaps you could explain how to make this work, thanks

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Vba replacing all occurrences of "-" in a sheet

    It worked for me. What do you mean by "it works for regular data"? What data does it not work for?

    Please see yellow banner at the top of the page and attach your file.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-18-2020
    Location
    London
    MS-Off Ver
    2010
    Posts
    75

    Re: Vba replacing all occurrences of "-" in a sheet

    I've found it does replace "-" if they are in the upper part of the spreadsheet, but does not find those lower down.
    For example, I have some in row 233 onwards which it doesn't find.

    However I have now found a workaround using a different command which does work.

    Thank you for your reply.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Vba replacing all occurrences of "-" in a sheet

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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] making all occurrences of a value match the change made in one of those occurrences
    By GAZZYMAN in forum Excel Programming / VBA / Macros
    Replies: 27
    Last Post: 03-23-2017, 10:51 PM
  2. Add number of occurrences from one sheet and place on another
    By david.72 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-28-2015, 09:20 AM
  3. [SOLVED] Count number of occurrences in month (google sheet)
    By Juliansmity in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-13-2015, 12:17 PM
  4. extract all occurrences of one name and display the data on a new sheet
    By superturtle in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-26-2014, 01:56 PM
  5. Update Details in Sheet 1 to Sheet 2 without replacing old Data
    By Sri.n in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2013, 07:43 AM
  6. replacing a sheet a sheet from another spreadsheet = updating range names
    By michael_aussie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2012, 03:23 AM
  7. Replace method in macro - Macro not replacing all occurrences
    By slw_gen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2011, 06:57 PM

Tags for this Thread

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