+ Reply to Thread
Results 1 to 14 of 14

Import data from website different websites using change in cell information?

  1. #1
    Registered User
    Join Date
    07-27-2020
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    19

    Import data from website different websites using change in cell information?

    Is it possible to change the website of which my excel is getting its data from within a cell?

    E.g.
    I'm getting static data on employee number 1515 from intranet.com/1515

    But instead of changing the website manually everytime, I need to have a cell where i can just write 1516 (employee number) and now the data will change.

    - Is this 'feature' possible? If anyone knows of a youtube where this is shared I would very much appreciate it.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Import data from website different websites using change in cell information?

    a1 = intranet.com/
    b1 = 1515

    c1 = a1&b1

    If you drag the formula down and
    b2 = 1516

    c2 => result => intranet.com/1516
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Import data from website different websites using change in cell information?

    If you are using Get & Transform -> Get Data -> From Web. To query data...

    You set up 2 named cells. 1 to hold static path and another for employee number (or if path never changes, you can hard code that portion in the query).

    I'd then set up list of available/valid employee number as validation list for the 2nd named cell.

    In Query editor, use something like below to set up variable(s).
    Please Login or Register  to view this content.
    Then use Text.From() on the value from employee number and concatenate it with first part. Using it as argument in the query.

    If you are using WEBSERVICE() function to obtain data... you can do much the same set up, but just need to pass the employee number to formula, rather than query.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Registered User
    Join Date
    07-27-2020
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    19

    Re: Import data from website different websites using change in cell information?

    I'm using the Data -> From Web

    But I can't do it the way your are explaining - I just made the example with numbers, but in reality it is between 3-5 initials and a lot of employees

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Import data from website different websites using change in cell information?

    Can't you just prepare table/list of valid entries? That info must be stored somewhere for it to work on Web Query.

    At any rate, you can just replace data validation with manual typing. That's not going to change the method used.

  6. #6
    Registered User
    Join Date
    07-27-2020
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    19

    Re: Import data from website different websites using change in cell information?

    No I can't just make a list of entries as we are getting a huge amount of employees entrying and leaving everyday.

    The dynamic cell has to be without a list and just for whatever I want to write.

  7. #7
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Import data from website different websites using change in cell information?

    So just do that. As I stated in the previous post. Nothing else changes. Logic for passing on the named range / value to query remains same.

  8. #8
    Registered User
    Join Date
    07-27-2020
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    19

    Re: Import data from website different websites using change in cell information?

    Okay, then I really don't understand what you want me to do.

    I've read the post several times

  9. #9
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Import data from website different websites using change in cell information?

    I'd recommend uploading sample workbook. Showing your set up, and what you wish to accomplish.

    I can only give you general advise without knowing your intension. I am not a mind reader after all

  10. #10
    Registered User
    Join Date
    07-27-2020
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    19

    Re: Import data from website different websites using change in cell information?

    I don't have any workbook regarding this feature.

    For now it is only a feature I would like to see if can be done and then maybe implement it in a real worksheet.

    So for now I have only tested Data -> 'Webside' -> Table 0 and Table 1 -> Load to 'Existing worksheet'


    But it is basically the same thing I want to implement, just where I use e.g. intranet.com/ as a base formel and kan type anything else in e.g. B2 and it will merge it to the link and import data from the website (table 0 and table 1)

  11. #11
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Import data from website different websites using change in cell information?

    So, just hard code the "intranet.com/" part in the query itself. Then pass on B2 as named range to query and use it to construct your query.

    See link where I detailed concept. Post#5
    https://chandoo.org/forum/threads/us...s-notes.35658/

    And example of usage in thread below. Post#7
    This was specifically used for native SQL query, but exactly same principle applies to web query.
    https://www.excelforum.com/excel-pro...cel-range.html

  12. #12
    Registered User
    Join Date
    07-27-2020
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    19

    Re: Import data from website different websites using change in cell information?

    Sorry but I'm a complete Excel novice and learning/copying everything from youtube and trying to change specific parts.

    What you just posted is russian for me and I don't even get where to put the code. VBA is not accepting it and I am not able to oben Edit Query (faded tab)

  13. #13
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Import data from website different websites using change in cell information?

    No VBA is used.

    Before you try to make it dynamic. I'd recommend you query your data and make sure that you have the data structure you want.

    Once that's confirmed, add new worksheet in the same workbook and add your named range (or it can be done in same sheet if needed).

    Then Data -> "Queries & Connections". Double click on the query. It will take you to query editor.

    In the ribbon tool of query editor, View -> Advanced editor. That's where you'd insert line to define your variable and retrieve data from named range.

    Google search for "powerquery named range as parameter" and you should find plenty of tutorials and videos.

  14. #14
    Registered User
    Join Date
    07-27-2020
    Location
    Denmark
    MS-Off Ver
    2019
    Posts
    19

    Re: Import data from website different websites using change in cell information?

    I'm trying and trying - Can't get this to work.

    Most be a different way like a VBA

+ 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. How to import web page information from similar website URL's using macros
    By rossleavitt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2018, 10:11 PM
  2. How to import data from websites?
    By unalak in forum Excel General
    Replies: 1
    Last Post: 02-28-2017, 09:23 AM
  3. Import data from multiple websites (loop?)
    By Nina07 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-24-2016, 02:59 PM
  4. import data from multiple pages of a websites into excel
    By nicolasmarin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2015, 11:02 AM
  5. get data from website using websites button
    By trijn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-15-2015, 02:11 AM
  6. Web query to import only limited information from website
    By boomtown25 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-18-2014, 06:04 PM
  7. import data from websites that end with aspx
    By excellentexcel in forum Excel General
    Replies: 5
    Last Post: 08-12-2010, 01:53 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