Hi,
I have a userform where the user selects a material code and a time. Based on a lookup table a formula then reads the related cost to the code and multiplies it by the time giving a total cost. However on occassion the cost needs to be entered manually so if the material code is set to "117" I need a textbox that the user will enter the correct price into. I thought I'd solved this by making a popup box which had a textbox where the manual cost was entered. This figure was then saved in the 117 cost column of the lookup. This worked except the next time the user manually enters a figure then it changes all the previous 117 entries to be the same value.
The two ways I can think of are either to use an IF argument and say IF the material code is 117 then the forumla is overriden and the cost is entered directly into the database instead of going through the lookup table.
The other is to make a textbox that's only visible if 117 is selected and then write code that will recognize if it's 117 then the lookup formula is overrided and the manually entered cost is saved straight into the cost column.
The third way I can think of is to re-write the whole workbook but this would be highly stressful! so first I thought I'd check if anyone has any suggestions.
I've attached a copy of the workbook because i'm not quite sure which are the relevent bits of code.
Thank you all so so much!
Bookmarks