Custom Worksheet

jwbatey07

New Member
Joined
Apr 14, 2020
Messages
33
Office Version
  1. 365
Platform
  1. Windows
I am working on building a custom worksheet for our operation. We build custom hose assemblies and there are thousands of combinations depending on the hose type, hose size, pressure, and end connection. I have successfully created a form of sorts in excel. My current working form only use Selections and the Indirect function. The issue is when you change the informtion on a fields toward the top of the form it leaves the old, possible incorrect information behind. I would also like to print the information once a form is filled out then clear the fields for the next assembly. I've stumbled on VBA and have attempted to create a cleaner and more functional form in Visual Basic. I've been able to create some of the beginning comboboxs I'm going to need. Once i get past the second combobox everything starts to go south. Unfortunately, the raw data is not the neatest nor is it simple.

THE Sample of the form
HOSE TYPESIZEHOSE TYPEHOSE SELECTION
HYDRAULICHYD_4HYD_4_DOUBLEHB6K_4
FITTING TYPE 1FITTING TYPE 2
JIC_4_SER_2NPT_4_SER_2
FITTING 1 FITTING 2
F2-0406-JFSF2-0404-PF
FERRULE TYPEFERRULE 2
NONE NEEDEDNONE NEEDED
FERRULE 1FERRULE 2
400_B380_B



THE CODE
Private Sub ComboBox1_Click()
Dim x As Integer
x = ComboBox1.ListIndex

Select Case x
Case Is = 0
ComboBox2.RowSource = "Hydraulic"
Case Is = 1
ComboBox2.RowSource = "air_or_water"
Case Is = 2
ComboBox2.RowSource = "fuel"
Case Is = 3
ComboBox2.RowSource = "ac"
Case Is = 4
ComboBox2.RowSource = "ptfe"

End Select

End Sub



Private Sub ComboBox2_Click()
Dim x As Integer
x = ComboBox2.ListIndex



Select Case x
Case Is = 0
ComboBox3.RowSource = "hyd_3"
Case Is = 1
ComboBox3.RowSource = "hyd_4"
Case Is = 2
ComboBox3.RowSource = "hyd_6"
Case Is = 3
ComboBox3.RowSource = "hyd_8"
Case Is = 4
ComboBox3.RowSource = "hyd_10"
Case Is = 5
ComboBox3.RowSource = "hyd_12"
Case Is = 6
ComboBox3.RowSource = "hyd_16"
Case Is = 7
ComboBox3.RowSource = "hyd_20"
Case Is = 8
ComboBox3.RowSource = "hyd_24"
Case Is = 9
ComboBox3.RowSource = "hyd_32"
Case Is = 10
ComboBox3.RowSource = "air_4"



End Select



End Sub



Private Sub ComboBox3_Click()

Dim x As Integer
x = ComboBox3.ListIndex

Select Case x
Case Is = 0
ComboBox4.RowSource = "HYD_3"
Case Is = 1
ComboBox4.RowSource = "HYD_4_SINGLE"
Case Is = 2
ComboBox4.RowSource = "hyd_4_double"
Case Is = 3
ComboBox4.RowSource = "hyd_4_100r5"
Case Is = 4
ComboBox4.RowSource = "hyd_4_100r7_non_conductive"
Case Is = 5
ComboBox4.RowSource = "hyd_4_100r8_non_conductive"



End Select

End Sub

Private Sub UserForm_Initialize()
ComboBox1.RowSource = "type"

End Sub


THE DATA
1586890154500.png



Any help someone can give me to steer me in the right direction would be greatly appricated.

Regards,

James
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,984
Members
449,058
Latest member
oculus

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