+ Reply to Thread
Results 1 to 14 of 14

VBA Stock List creation

  1. #1
    Registered User
    Join Date
    05-29-2021
    Location
    Coffs Harbour
    MS-Off Ver
    2019
    Posts
    6

    VBA Stock List creation

    Hello All,

    I am new here and as usual someone with a coding problem.
    New to excel vba but have had many years of access vba coding.

    I have a sheet with a range of products (6 chr Uppercase text) and quantities, each represents
    one pallet of stock in a row in warehouse.
    I need to create a stock take list of the row name (first row of sheet) then each individual (unique)
    product and count in that row. Some rows can have multiple different products.
    Have been looking at the Scripting Dictionary as it returns the fastest results, so far unsuccessfully.

    Any assistance would be greatly appreciated.

    Mike
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA Stock List creation

    Hi Mike & welcome to the forum,

    Try below code based on you sample file ... I don't know what's supposed to be under "Product" & "Count" since it doesn't show anything in your sample file
    Please Login or Register  to view this content.
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

  3. #3
    Registered User
    Join Date
    05-29-2021
    Location
    Coffs Harbour
    MS-Off Ver
    2019
    Posts
    6

    Re: VBA Stock List creation

    WOW, that's an impressive piece of coding.
    I will need a bit of time to go through it (to learn)

    Exactly what I was looking to do, thank you Nankw83

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: VBA Stock List creation

    Just for the fun of it...Another option...
    Please Login or Register  to view this content.
    Last edited by sintek; 07-17-2021 at 06:40 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: VBA Stock List creation

    Quote Originally Posted by mikeopp View Post
    thank you Nankw83
    Glad to help & thanks for the added Rep+ ... If the provided solutions take care of your original question, please take a moment & mark the thread as [SOLVED] from the Thread Tools above your first post

  6. #6
    Registered User
    Join Date
    05-29-2021
    Location
    Coffs Harbour
    MS-Off Ver
    2019
    Posts
    6

    Re: VBA Stock List creation

    Hi Sintek,
    Smooth, another fine solution. straight into the stock take sheet. Nice to read too.

    Thank you

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: VBA Stock List creation

    .........................
    Thanks.png

  8. #8
    Registered User
    Join Date
    05-29-2021
    Location
    Coffs Harbour
    MS-Off Ver
    2019
    Posts
    6

    Re: VBA Stock List creation

    Very close to a complete solution, need to bounce a couple more things off you.
    Have an updated example attached for you.
    Slightly changed the code and added a full clearer example.
    Questions as follows

    Question 1. Sheets("Stocktake").Range("A3").Resize(x, 5)
    how do you preserve the content of the 3rd column (product)

    Question 2. I have broken the code into 4 groups for each area to loop through,
    can this be put into one piece of code

    Question 3. You will note in the count column i have varying numbers, these are part pallets
    is there an easy way to bring these in too

    Also with both lots of code I get occasional miscounts or it will put in 2 consecutive rows with the same code. (I can work with that though)
    Thank you again, your help is greatly appreciated
    Mike
    Attached Files Attached Files

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: VBA Stock List creation

    I know you were not referring to me in above, but had some time...
    Your initial Stock Sheet set up & layout should be more thought out...
    I moved your Product Table to the stock sheet and added one more entry in [B80] to allow that to become one area...
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-29-2021
    Location
    Coffs Harbour
    MS-Off Ver
    2019
    Posts
    6

    Re: VBA Stock List creation

    Now that's nice work. That's a tenth of the master sheet, it grew as it was needed. Of course I haven't found
    time to rearrange it... yet :D
    Thank you Sintek for your time once again, and an ideal solution.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: VBA Stock List creation

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  12. #12
    Registered User
    Join Date
    05-29-2021
    Location
    Coffs Harbour
    MS-Off Ver
    2019
    Posts
    6

    Re: VBA Stock List creation

    Thankyou AliGW. I have already given Sintek and Nankw83 rep.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,460

    Re: VBA Stock List creation

    However, you have not marked the thread as solved. Please do so. Thanks.

    EDIT: You have now!

  14. #14
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,176

    Re: VBA Stock List creation

    All good Mike...thanks...happy coding...

+ 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. Need to delete rows from supplier stock list to only show stock I sell
    By Esales in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-07-2020, 12:42 AM
  2. [SOLVED] creating a stock list - need to know how much material i have in stock
    By AleksBabic in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-27-2016, 07:10 AM
  3. Replies: 31
    Last Post: 10-28-2015, 01:54 AM
  4. [SOLVED] Stock list using Vlookup, need the price field to read as TBA is stock on hand is 0
    By meerabell in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-31-2015, 07:42 AM
  5. Replies: 4
    Last Post: 01-29-2013, 02:26 AM
  6. Replies: 0
    Last Post: 10-28-2012, 07:22 AM
  7. List creation
    By oscar_kelley in forum Excel General
    Replies: 0
    Last Post: 02-27-2008, 07:55 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