+ Reply to Thread
Results 1 to 8 of 8

Data from web, replace a "." with a "," -problem

  1. #1
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Data from web, replace a "." with a "," -problem

    Hi all,

    I have a workbook where i get some data from the web. Earlier the data i collected came in the right format: numbers where separated with a "," so it could be calculated. To get new data from the web i had a simple macro that refreshed my workbook.
    Please Login or Register  to view this content.
    .

    Now the webpage has made some changes. They have replaced the "," with a "." so when i collect the data from the web my formulas in the workbook cant be calculated beacuse its not a number. My solution to this was to record a macro where I replaced all the "." with a ",".
    Please Login or Register  to view this content.
    When i run the macro it seems like the refresh part of the code takes a little bit too long so the replacement is done before the refreshment. If i just step myself through the code with F8 it works but when i run the entire code the replacement is done before the refresh (getting new data from the web).

    The entire code is those two parts above:
    Please Login or Register  to view this content.
    How can i make this work? Any ideas?

    /Masun

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Data from web, replace a "." with a "," -problem

    doevents may help, but not sure. put it after the refreshall line
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Data from web, replace a "." with a "," -problem

    Hi Masun,
    could you upload a file with an example of your data

  4. #4
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Data from web, replace a "." with a "," -problem

    Thanks for your replay.

    Ok, uploaded the file...
    Attached Files Attached Files

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Data from web, replace a "." with a "," -problem

    Masun,
    maybe it would be suitable for you
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Data from web, replace a "." with a "," -problem

    Hi Nilem,

    Thank you very much. That solution works. But there are more tables from other sites that needs to be "hardcoded" instead of the simplier way of refreshing the workbook. Do you have any idea of why the "refresh thing" in the code is done before the "replacement thing"...

    /Masun

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Exclamation Re: Data from web, replace a "." with a "," -problem


    Hi,

    'cause of the QueryTable's BackgroundQuery & Refresh properties as you must read into the code ‼
    Last edited by Marc L; 12-12-2013 at 06:08 AM.

  8. #8
    Forum Contributor
    Join Date
    01-11-2013
    Location
    Sweden
    MS-Off Ver
    MS 365
    Posts
    188

    Re: Data from web, replace a "." with a "," -problem

    Ok,

    How do i change my code so the "QueryTable's BackgroundQuery & Refresh properties" are done in correct order? I want to get the data from the web and when thats done i want to replace the "." with the ","

    /Masun

+ 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. replace all defined range names in the sheet that start with "Street" to "Road"
    By matrex in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 11-04-2016, 08:53 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. Replies: 2
    Last Post: 06-06-2013, 12:45 PM
  5. Replies: 7
    Last Post: 05-13-2006, 05:02 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