Results 1 to 7 of 7

replacement with macro stop values from working in formula

Threaded View

  1. #1
    Registered User
    Join Date
    12-13-2012
    Location
    HOLLAND
    MS-Off Ver
    Excel 2003
    Posts
    4

    replacement with macro stop values from working in formula

    hey everyone,

    just a small note, im using a bit of an outdated excel version, excel 2003 to be exact.

    for a small assignment i have been tinkering with the excel macro function.
    the assignment involves importing different text files into 1 excel sheet and formatting them so they can be used in formula's and graphs.

    the files that are delivered however use a . instead of a , as decimal seperator. this is where my problem starts.
    ive gotten far enough to get everything working with the macro.
    but when i use the replace function with CTRL+H to replace all the . for , everything is fine and the values all work in their formula's.

    but as soon as i let me macro function replace these . for , the values all stop working.
    as soon as i double click on the cell and proceed to click out of the cell, note: not changing anything, the cell works in my formula again.

    the bit of code is use to replace the . with , is as follows:


    Range("A2:K2").Select
        Range(Selection, Selection.End(xlDown)).Select
        Selection.replace What:=".", Replacement:=",", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
            ReplaceFormat:=False
    the macro im writing is going to be used by other people, so i'd love to find out what causes this problem so that i can automate the process as much as possible.

    if anyone knows a solution, i'd very much appreciate the help.
    thanks in advance,
    Diederik

    edit:
    i just figured that a possible solution might be to prompt the same window CTRL+H opens using VB.
    if anyone knows the code for this, please let me know. ive been fairly new to VB and mostly figuring things out by recording and looking at what kind of code that generates
    Last edited by diederik777; 12-17-2012 at 10:13 AM.

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