+ Reply to Thread
Results 1 to 8 of 8

VBA to incorporate additional data into a data set

  1. #1
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    VBA to incorporate additional data into a data set

    Hi all,

    I have some data and need to incorporate additional detail into it. There are two separate data sets to be incorporated into the main data, region and specialism data.

    I've attached an example of the data I'm working with along with an example which shows what I'm looking to achieve.

    If you have any queries just give me a shout.

    Thanks in advance,

    Snook

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: VBA to incorporate additional data into a data set

    This is simple using Power Query.

    Format your three data sources as tables (MainData, RegionData and SpecialismData), then use:

    Please Login or Register  to view this content.
    Worked example attached.
    Attached Files Attached Files
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: VBA to incorporate additional data into a data set

    Cheers Olly. Now seems a good time to dip my toe into the Power Query scene so I've requested the add-in to be installed on my laptop.

    I'll let you know how I get on.....

  4. #4
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: VBA to incorporate additional data into a data set

    Hi Olly,

    I've just looked at the output you produced based on my sample data and it has grown from ~30 rows to ~950. The actual data I'm working with is ~5500 rows and the regions and specialisms will be far more extensive than my example. As such I'm concerned that I'll blow Excel's mind! As in my resultant data set will exceed the max rows (~1m).

    Any suggestions on what alternative approaches/solutions are available to me if this is the case?

    Cheers,

    Snook

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: VBA to incorporate additional data into a data set

    It depends what you're planning to do with the output...

    What are you actually trying to achieve?

  6. #6
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: VBA to incorporate additional data into a data set

    I'm helping someone out in work but I believe that the ultimate goal is to produce some sort of pricing tool.

    We'll have a dataset of all the suppliers, regions, specialisms etc and customers will be able to use the tool to query what rate they would have to pay for certain requirements, e.g. a teacher based in the North East.

    The current one is Excel based and I believe that this will need to be the case for the new one. It will be used by various customers with varying IT setups but they'll all have Excel as a minimum. They're unlikely to have any associated add-ins though so it really needs to be a 'no frills' solution (VBA is ok).

    Thinking out loud we may just have to split the dataset down by one of the elements (probably lot) and create separate tools.

    It obviously hinges on the size of the dataset though so I'll see how the land lies once IT have installed PQ on my laptop.

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: VBA to incorporate additional data into a data set

    Well, if you're intending to have a unique price for every combination of dimension values, and you're worried about exceeding 1M rows, then I really don't fancy the job of updating / maintaining THAT list!!

  8. #8
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: VBA to incorporate additional data into a data set

    Lol yeah I know what you mean. Thankfully that won't be my problem!

+ 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. Replies: 0
    Last Post: 08-07-2018, 05:06 AM
  2. Replies: 3
    Last Post: 01-30-2018, 07:26 PM
  3. [SOLVED] How do I incorporate an additional case command?
    By bralew in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-07-2016, 05:12 AM
  4. Need Additional Macro Code to clear out data from secondary Page after data has been chang
    By ExcelBeginner326 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-26-2014, 02:05 PM
  5. Replies: 0
    Last Post: 08-10-2010, 11:01 AM
  6. How to incorporate cell data in a worksheet header
    By John Bennett in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-12-2006, 03:20 AM
  7. How to I incorporate SD from a data series into chart error bars?
    By carlosPharm.D in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 08-02-2005, 05:05 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