I have a general VB question that I was hoping someone can shed light on.
I have developed an elementary expense report for my company using Excel as the interface and some VB code. The excel interfaces includes a number of comboboxes with user selections. An example of the code is as follows:
Private Sub ComboBox1_Change()
resetAllChildDropDowns1
If ComboBox1.Value = "Asia Buyout" Then
ComboBox2.ListFillRange = "g73:g73"
ElseIf ComboBox1.Value = "Asia Venture Fund" Then
ComboBox2.ListFillRange = "g74:g75"
ElseIf ComboBox1.Value = "CAMG-Fund of Funds" Then
ComboBox2.ListFillRange = "g76:g76"
ElseIf ComboBox1.Value = "CAMG-Secondary Fund" Then
ComboBox2.ListFillRange = "g77:g77"
ElseIf ComboBox1.Value = "CMG Fund" Then
ComboBox2.ListFillRange = "g78:g96"
ElseIf ComboBox1.Value = "Energy Fund" Then
ComboBox2.ListFillRange = "g97:g99"
ElseIf ComboBox1.Value = "Europe Buyout" Then
ComboBox2.ListFillRange = "g99:g99"
ElseIf ComboBox1.Value = "Europe Real Estate" Then
ComboBox2.ListFillRange = "g101:g101"
ElseIf ComboBox1.Value = "Europe Venture" Then
ComboBox2.ListFillRange = "g102:g102"
ElseIf ComboBox1.Value = "Japan Buyout" Then
ComboBox2.ListFillRange = "g103:g103"
ElseIf ComboBox1.Value = "Japan Venture" Then
ComboBox2.ListFillRange = "g104:g104"
ElseIf ComboBox1.Value = "US Buyout" Then
ComboBox2.ListFillRange = "g105:g239"
ElseIf ComboBox1.Value = "US Real Estate" Then
ComboBox2.ListFillRange = "g240:g312"
ElseIf ComboBox1.Value = "US Venture Fund I" Then
ComboBox2.ListFillRange = "g313:g330"
ElseIf ComboBox1.Value = "US Venture Fund II" Then
ComboBox2.ListFillRange = "g331:g342"
End If
ComboBox2.Enabled = True
End Sub
My problem is that I am getting requests to add new projects to the expense reports on a daily basis. In order to do so I add the project name, accting code and some other stuff to the Excel spreadsheet and then have to make manual HARDCODED changes to the VB code in order to change the range in the Combobox.
Any suggestion would be appreciated. I am getting the feeling that VB is somewhat limiting in what I need to do and that Access would be the only way to go. Thanks.
I have developed an elementary expense report for my company using Excel as the interface and some VB code. The excel interfaces includes a number of comboboxes with user selections. An example of the code is as follows:
Private Sub ComboBox1_Change()
resetAllChildDropDowns1
If ComboBox1.Value = "Asia Buyout" Then
ComboBox2.ListFillRange = "g73:g73"
ElseIf ComboBox1.Value = "Asia Venture Fund" Then
ComboBox2.ListFillRange = "g74:g75"
ElseIf ComboBox1.Value = "CAMG-Fund of Funds" Then
ComboBox2.ListFillRange = "g76:g76"
ElseIf ComboBox1.Value = "CAMG-Secondary Fund" Then
ComboBox2.ListFillRange = "g77:g77"
ElseIf ComboBox1.Value = "CMG Fund" Then
ComboBox2.ListFillRange = "g78:g96"
ElseIf ComboBox1.Value = "Energy Fund" Then
ComboBox2.ListFillRange = "g97:g99"
ElseIf ComboBox1.Value = "Europe Buyout" Then
ComboBox2.ListFillRange = "g99:g99"
ElseIf ComboBox1.Value = "Europe Real Estate" Then
ComboBox2.ListFillRange = "g101:g101"
ElseIf ComboBox1.Value = "Europe Venture" Then
ComboBox2.ListFillRange = "g102:g102"
ElseIf ComboBox1.Value = "Japan Buyout" Then
ComboBox2.ListFillRange = "g103:g103"
ElseIf ComboBox1.Value = "Japan Venture" Then
ComboBox2.ListFillRange = "g104:g104"
ElseIf ComboBox1.Value = "US Buyout" Then
ComboBox2.ListFillRange = "g105:g239"
ElseIf ComboBox1.Value = "US Real Estate" Then
ComboBox2.ListFillRange = "g240:g312"
ElseIf ComboBox1.Value = "US Venture Fund I" Then
ComboBox2.ListFillRange = "g313:g330"
ElseIf ComboBox1.Value = "US Venture Fund II" Then
ComboBox2.ListFillRange = "g331:g342"
End If
ComboBox2.Enabled = True
End Sub
My problem is that I am getting requests to add new projects to the expense reports on a daily basis. In order to do so I add the project name, accting code and some other stuff to the Excel spreadsheet and then have to make manual HARDCODED changes to the VB code in order to change the range in the Combobox.
Any suggestion would be appreciated. I am getting the feeling that VB is somewhat limiting in what I need to do and that Access would be the only way to go. Thanks.