I am new to excel programming and would like some help with a custom data entry form...
I have created a userform called userform1, I would like this userform to be permanently located on/within the Sheet 'User Input' so it can be modified without a pup-up window appearing (minor issue though).
As you will see there are a couple of text input boxes and some drop down lists.
For the first drop down list, I would like the list to be populated with the names of the fuels that are found in the column "Fuels" on table "tblFuels" on sheet "Fuel Data", I've been unable to find a solution online. Should I use a Vlookup function or something similar?
Also I'm unaware how to enter the data from the text boxes in to specific cells, what function do i need and how do a reference a cell? Is it something like this: Worksheets(2).Range(B4)or Cells(B4)? I'm sure this is simple but i haven't found what I'm looking for.
If you take a look at the code for the 'userform1' you will see I've added some description of what i would like the form to do upon data being entered or when the "Calculate" button is pressed. Basically when a user enters some data and specifies the units of the data from a dropdown list, I want the form/macro to convert the value in to the other possible units and put the values in to some cells on a sheet.
This is my thoughts but I'm unsure on the commands/functions that i need.
Private Sub txtOpPress_Change()
'Put this value in to cells depending on the Unit's specified, i.e:
'If ListBoxOpPressUnits = mmHg then
'Put Value in to cell B5 on Worksheet(3)
'enter the value in the function 'mmHg2mBar' as variable 'UserInput' and put the result in cell B6 in worksheet(3)
'also enter the value in the function 'mmHg2kPa' as variable 'UserInput' and put the result in cell B7 in worksheet(3)
'End If
'If ListBoxOpPressUnits = mBar then
'Put Value in to cell B6 on Worksheet(3)
'enter the value in the function 'mBar2mmHg' as variable 'UserInput' and put the result in cell B5 in worksheet(3)
'also enter the value in the function 'mBar2kPa' as variable 'UserInput' and put the result in cell B7 in worksheet(3)
'End If
'If ListboxOpPressUnits = kPa Then
'Put Value in to cell B7 on Worksheet(3)
'enter the value in the function 'kPa2mBar' as variable 'UserInput' and put the result in cell B6 in worksheet(3)
'also enter the value in the function 'kPa2mmHg' again as variable 'UserInput' and put the result in cell B5 worksheet(3)
'End If
'Or would it be easier to put the value in to different cells depending on the Units? The final converted values would still need to be in the same cells as above.
I will continue working on the rest of the spreadsheet in the mean time and I'm sure there will be more questions to come but any help will be much appreciated.
File:
Fuels Spreadsheet.xlsm
Bookmarks