• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Pull data from one table to another|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Pull data from one table to another|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosPull data from one table to another
sp_PrintTopic sp_TopicIcon
Pull data from one table to another
Avatar
Ivica Lopar

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
September 20, 2019
sp_UserOfflineSmall Offline
1
September 25, 2019 - 6:11 pm
sp_Permalink sp_Print

Hello to all,

I need some help.

I have table looking this way

 

               A                                            B                          C                              D                         E

     Material name                       Machine 1         Machine 2               Machine 3            Machine 4

1    Material 1                                   prio1                                                    prio 2

2   Material 2                                                                   prio1                                                    prio 2

3   Material 3                                                                    prio1                                                  prio 1

4   Material 4                                   prio1                                                    prio2                     prio3                

5   Material 5                                   prio1                       prio2                     prio3                     prio4         

 

What I want to do, pull back in another table machine name sort by priorities

 

                                               Prio1                Prio2                   Prio3               Prio 4

Material 1                         Machine 1          Machine3

Material 2                         Machine 2           Machine 4

Material 3                         Machine 2          Machine 4

Material 4                         Machine 1           Machine 3       Machine 4

Material 5                         Machine 1           Machine 2         Machine 3     Machine 4    

 

Can somebody tell do i need code for this or some formula/function.

 

Bset regards

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
September 26, 2019 - 1:51 pm
sp_Permalink sp_Print

Hi Ivica,

It's much more easier in Power Query than vba, just Unpivot Prio columns then Pivot the new column created.

let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Material"}, "Attribute", "Value"),
#"Pivoted Column" = Table.Pivot(#"Unpivoted Other Columns", List.Distinct(#"Unpivoted Other Columns"[Value]), "Value", "Attribute")
in
#"Pivoted Column"

Avatar
Ivica Lopar

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
September 20, 2019
sp_UserOfflineSmall Offline
3
September 26, 2019 - 3:26 pm
sp_Permalink sp_Print

Hi Catalin,

i do not understand where code should be inserted

 

One more thing i have table with 1000 rows with materials and 25 machines with assigned priorities.

So I was thinking to have cells where where I can insert material name and in other cells machine priorities

thanks for feedback

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
4
September 27, 2019 - 5:01 am
sp_Permalink sp_Print

Hi Ivica,

It's a power query solution, it's in the sample file attached to my previous message All you have to do is to fill the table with your materials and priorities, then press refresh in the results table (right click-Refresh)

The file you attached is in a completely different structure than the one you provided initially so it brings confusion, not clarity.

You will have to try again and explain what you have and describe your process.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: RAQUEL ACION, Dana Friedt, Shawn Barwick, Nada Perovic, Uwe von Gostomski
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
terimeri dooriyan
Jack Aston
AndyC
Denise Lloyd
michael serna
mashal sana
Tiffany Kang
Leah Gillmore
Sopi Yuniarti
LAFONSO HERNANDEZ
Forum Stats:
Groups: 3
Forums: 24
Topics: 6218
Posts: 27266

 

Member Stats:
Guest Posters: 49
Members: 31901
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.