+ Reply to Thread
Results 1 to 2 of 2

Spin Button Min Based on Variable

Hybrid View

  1. #1
    Registered User
    Join Date
    05-24-2017
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 2016
    Posts
    1

    Spin Button Min Based on Variable

    Hey there,
    I am self taught in VBA and am reasonably new at this so please bear with me.
    Unfortunately I am unable to upload my spreadsheet due to sensitive content however I will explain as best as I can.

    I have a grid of rates in a spreadsheet that have been produced based on some predefined criteria. These rates would then change dependent on the product that has been selected in a Combo Box.
    There are 132 rates in the grid, and 13 products in the Combo Box.
    Once these rates have been produced, there is then some research carried out and on occasion the rates that are automatically produced need to be fine tuned by $1 or $2 - however there is a minimum sell rate that varies per product
    I then have a Userform that has each of the 132 rates display in one Textbox each (132 textboxes) when the Userform Initializes. A Combo Box and Command Button then manage the refreshing of the rates dependent on the product selected.
    To manage the adjustments that may need to be applied, I then have 132 Spin Buttons; one for each Textbox

    My hurdle that I have run into is ... how do I set Min to the Spin Buttons on Userform_Initialize() when there are 132 of them, and 13 different Min's (dependent on the product selected)?

    Any help would be MASSIVELY appreciated.
    Mike

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,926

    Re: Spin Button Min Based on Variable

    Without a workbook, the best I can do is respond with a verbal description.

    What I would do is create a pivot table on the data where the row header is the product. This pivot table gives you a unique list of product names. You an use this list to populate the ComboBox for product selection.

    In the same pivot table, in the values area put the value you are looking for and instead of SUM, use MIN.

    When the product is selected, find it in the range of the row headers in the pivot table, offset one cell to the right and grab the minimum value associated with it.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. ActiveX Control Spin Button Copy Button and Change Cell reference?
    By chrstphrbllngs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2016, 04:01 PM
  2. [SOLVED] Enable Disable spin button based on a textbox
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2015, 07:21 AM
  3. [SOLVED] Help with Spin Button. Set Spin button starting value based on a text box value
    By etuckram in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-18-2014, 10:05 AM
  4. Macro based on Spin Button Linked cell value
    By turist in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-20-2013, 11:57 AM
  5. Spin Button variable linked cell
    By Ozzmatron in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2013, 11:29 PM
  6. [SOLVED] Macro based on Spin Button Linked cell value
    By turist in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2013, 04:07 PM
  7. Spin Button:spin cells A7
    By ice in forum Excel General
    Replies: 1
    Last Post: 03-16-2007, 02:23 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