Dynamic Change of Table

8700Rakf

New Member
Joined
May 15, 2019
Messages
32
So i have several dropdown menues, where VersionBox, ClassBox etc already is predefined by my code.

So what i am having trouble with, is to have a dynamic way to change the range values. it all depends on the version, the class, scaling, max weight and so on.

TypeBox: Increases the range with 1x(Normal), 5x(Post Scale) and 20x(scale)
WeightBox: sets max weight of the range
VersionBox: What version i want to work with
ClassBox: Which Sub Version i want to work with
UnitBox: it i want it to be in g, Kg or lb

So depending on what i choose from these boxes, i want the table to change. Any who knows a good way to do this?

Code:
Sub VersionBox_Click()





If VersionBox = "OIML R51 1996 (Old EU)" And ClassBox = "Y(a)" And TypeBox = "Normal" And ScaleIntervalBox = "Single" And WeightBox = "1000" Then
        
        Range("A14").Value = "5 &  <  m  < 500"
        Range("A15").Value = "500 &  <  m  < 2000"
        Range("A16").Value = "2000 & <  m  < 1000"
        Range("A17").Value = ""
        
        Range("M14").Value = "e = 1"
        Range("M15").Value = "e = 1"
        Range("M16").Value = "e = 1"
        
        
        
ElseIf VersionBox = "OIML R51 2006 (New EU)" And ClassBox = "Y(a)" And ScaleIntervalBox = "Single" Then
        Range("A14").Value = Value1 & " <  m  < 500"
        
ElseIf VersionBox = "OIML R51 2006 (New EU)" And ClassBox = "Y(b)" And ScaleIntervalBox = "Single" Then
        Range("A14").Value = Value1 & " <  m  < 50"
        
ElseIf VersionBox = "OIML R51 2006 (New EU)" And ClassBox = "Y(a)" And ScaleIntervalBox = "Multi" And ScaleIntervalBox2 = "10/20" And ScaleBox = "Normal" And WeightBox = 1000 Then
      
        
        
        Range("M14").Value = "e = 10"
        Range("M15").Value = "e = 10"
        Range("M16").Value = "e = 20"
        Range("M17").Value = "e = 20"
        
ElseIf VersionBox = "OIML R51 2006 (New EU)" And ClassBox = "Y(a)" And ScaleIntervalBox = "Multi" And ScaleIntervalBox2 = "20/50 V1" Then
        Range("A14").Value = "100 <  m  < 10000"


ElseIf VersionBox = "OIML R51 2006 (New EU)" And ClassBox = "Y(a)" And ScaleIntervalBox = "Multi" And ScaleIntervalBox2 = "20/50 V2" Then
        Range("A14").Value = "100 <  m  < 1000"
End If
End Sub
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,214,376
Messages
6,119,174
Members
448,870
Latest member
max_pedreira

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top