Hello,
This is my first time to this forum and first time programming vba, what I need to do is simple in theory but is proving to be difficult. I have just a couple little problems and if you can help with one or any please do, any suggestion would be greatly appreciated.
With that said I am trying to create a user interface with a database behind it. The user starts the program and has 3 options to pick from, type, beam, and load. These are 3 comboboxes with drop down lists to pick from and everything works fine because they are pre determined ranges.
When the user clicks next it brings them to a second userform with 2 more options, force and measurement, this is where I am having problems. Based on the beam and load type the user selects for the first one, their options for the first combobox should change.
Example: If the user selects beam 1b for the beam combobox then the program should select sheet 1b. If the user then selects shear for the load combobox in that sheet it should select a specific range. Then on the next userform it should display the that range under the force combobox.
I was trying to do this by setting them as global variables and having if statements to set them accordingly (you can look at the code for that) but it isnt working really Im not sure why, Idk if the variables carry over to the second userform?
The second problem I have is that when the user picks one of the options from the [B]force[B] I want it to actually go to the range that it gives the options from and find the value the user picks, to then be able to offset the selected cell to the right and give an according value. However when I try and use the statement:
to accomplish that it gives the error: 'Run-time error '1004': Select method of Range class failed'
Also I have just picked an abritrary sheet and range so that I can test it, that is where the sheet and range from the first userform should go. With that when I put a named range in where 'B1' is I get another error but I think its because its selecting the whole range, not just the first cell, how would I have it select the first cell in that range so that it can look through the range cell by cell accordingly to find the value.
Sorry for writing so much but it warranted some explaination, please let me know if you can help
First Userform code:
Second Userform Code:
Bookmarks