Results 1 to 3 of 3

user defined macro to replace certain characters in a string based on user input

Threaded View

whatappears user defined macro to replace... 12-17-2012, 05:41 PM
GaidenFocus Re: user defined macro to... 12-17-2012, 06:01 PM
jindon Re: user defined macro to... 12-17-2012, 06:25 PM
  1. #1
    Registered User
    Join Date
    12-10-2012
    Location
    Boulder, CO
    MS-Off Ver
    Excel 2010
    Posts
    7

    user defined macro to replace certain characters in a string based on user input

    All,

    Declared... I am not a VBA programmer.

    Assume you want to replace a list of characters with another list of characters in a particular cell with a user defined function. For example... "!@#$%" and "* ()_" ... you want each instance of "!" to be replaced with "*", each instance of "@" with space, "#" with "(" and so on.

    Something like this for the active cell:
    function creplace()
        prompt user for from characters and to characters
        for x=1 to numcharacters
              cellvalue =  Replace(cellvalue, from_character, to_character)
        next x
    end function
    In other words, could somebody have the function invoke a dialogue the user for the "from characters" and the "to characters" so that this is truly dynamic.

    I ask because I have looked and not found this to my surprise. I was told ASAP utilities had it, but I installed it and could not find it.
    Last edited by vlady; 12-17-2012 at 07:46 PM. Reason: code tags

Thread Information

Users Browsing this Thread

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

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