+ Reply to Thread
Results 1 to 8 of 8

Code to combine Stock Item Details

  1. #1
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2019 PRO
    Posts
    3,616

    Code to combine Stock Item Details

    Find attached file

    Need macro to combine stock code which are on various cells

    This I have manually written AXE POLARIS DEODORANT APOLLO - 150 ML X 12
    where AXE POLARIS DEODORANT is on a1 APOLLO on a2 and 150 ML X 12 is on E1
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2019 PRO
    Posts
    3,616

    Re: Code to combine Stock Item Details

    data on sheet 1 , see expected results on sheet 2

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,892

    Re: Code to combine Stock Item Details

    With Power Query

    Please Login or Register  to view this content.
    Excel 2016 (Windows) 32 bit
    A
    1
    Merged
    2
    AXE POLARIS DEODORANT APOLLO 150 ML X 12
    3
    AXE POLARIS DEODORANT BLACK 150 ML X 12
    4
    AXE POLARIS DEODORANT BLACK NIGHT 150 ML X 12
    5
    AXE POLARIS DEODORANT COLLISION 150 ML X 12
    6
    AXE POLARIS DEODORANT DARK TEMPTATION 150 ML X 12
    7
    AXE POLARIS DEODORANT EXCITE 150 ML X 12
    8
    AXE POLARIS DEODORANT GOLD 150 ML X 12
    9
    AXE POLARIS DEODORANT MARINE 150 ML X 12
    10
    AXE POLARIS DEODORANT MUSK 150 ML X 12
    11
    AXE POLARIS DEODORANT DARK TEMPTATION 150 ML X 72
    12
    AXE POLARIS DEODORANT MUSK 150 ML X 72
    13
    AXE POLARIS DEODORANT WILD SPICE 150 ML X 72
    14
    DOVE DEODORANT ANTI BACTERIA ( M ) 150 ML X 12
    Sheet: Table1

    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2019 PRO
    Posts
    3,616

    Re: Code to combine Stock Item Details

    Nice one need something without Power Query

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Code to combine Stock Item Details

    Please try

    Please Login or Register  to view this content.
    or formula

    =IFERROR(INDEX(Sheet1!$B$1:$B$98&" "&Sheet1!$B$2:$B$99&" "&Sheet1!$E$1:$E$98,AGGREGATE(15,6,ROW(Sheet1!$A$1:$A$98)/(Sheet1!$A$1:$A$98>0),ROWS(C$1:C1))),"")

    or Power Query

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Bo_Ry; 01-20-2021 at 06:04 AM.

  6. #6
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2019 PRO
    Posts
    3,616

    Re: Code to combine Stock Item Details

    Bo_Ry , this works for me , but please modify code to read longer range at like 200 rows , thank you

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Code to combine Stock Item Details

    VBA code uses the whole column
    Sheet1.Columns(1)

    The formula can use for 998 rows, you need to adjust the row number

    =IFERROR(INDEX(Sheet1!$B$1:$B$998&" "&Sheet1!$B$2:$B$999&" "&Sheet1!$E$1:$E$998,AGGREGATE(15,6,ROW(Sheet1!$A$1:$A$998)/(Sheet1!$A$1:$A$998>0),ROWS(C$1:C1))),"")

    Power Query
    Adjust table range to cover all your data.

  8. #8
    Forum Contributor
    Join Date
    01-04-2014
    Location
    East Africa
    MS-Off Ver
    MS OFFICE 2019 PRO
    Posts
    3,616

    Re: Code to combine Stock Item Details

    Thank you Bo_Ry , it sorts my situation

+ 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. [SOLVED] Formula to combine two worksheet details if equal
    By patxlb in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-09-2020, 10:13 AM
  2. [SOLVED] Help adding a stock item to a table.
    By CPAC in forum Excel General
    Replies: 3
    Last Post: 05-19-2018, 07:53 AM
  3. Invoice sale, purchase and stock details problem
    By dj_sajju in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-03-2015, 12:23 PM
  4. VBA Code to pull Stock Balance Sheet Data from a Stock Symbol in a cell
    By akash1229 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-27-2015, 04:37 PM
  5. Replies: 12
    Last Post: 03-17-2014, 06:55 PM
  6. Subtracting and adding from a stock sheet according to the item code
    By Dyls in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-06-2013, 11:49 AM

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