ed.ayers315
Board Regular
- Joined
- Dec 14, 2009
- Messages
- 166
Hi Folks,
I have written the following code to calculate the results in other textboxes. This works fine until I start with a decimal point.
If I start entering with a 0 then the decimal it still works.
So I have two questions:
1) Is there a way to allow the user to start with a decimal i.e. (.11) or will they have to type (0.11)?
2) Is there a way to keep the data in the cells after the form is closed. The results are still in the workbook cells and I would like them to stay visable when reopening the form until the worksheet is cleared?
Here is the Code:
[Private Sub TB45A_Change()
ActiveSheet.Unprotect
TB45B.Value = Application.WorksheetFunction.VLookup(Range("I13"), [SELF_CONTAINED_DATA], 14, 0) & " PPM"
TB46B.Value = Application.WorksheetFunction.VLookup(Range("I13"), [SELF_CONTAINED_DATA], 15, 0) & " PPM"
TB46A.Value = Round(CDbl(TB45A.Value) / 128 * 1000000, 0) & " PPM"
End Sub]
Thanks for any help
I have written the following code to calculate the results in other textboxes. This works fine until I start with a decimal point.
If I start entering with a 0 then the decimal it still works.
So I have two questions:
1) Is there a way to allow the user to start with a decimal i.e. (.11) or will they have to type (0.11)?
2) Is there a way to keep the data in the cells after the form is closed. The results are still in the workbook cells and I would like them to stay visable when reopening the form until the worksheet is cleared?
Here is the Code:
[Private Sub TB45A_Change()
ActiveSheet.Unprotect
TB45B.Value = Application.WorksheetFunction.VLookup(Range("I13"), [SELF_CONTAINED_DATA], 14, 0) & " PPM"
TB46B.Value = Application.WorksheetFunction.VLookup(Range("I13"), [SELF_CONTAINED_DATA], 15, 0) & " PPM"
TB46A.Value = Round(CDbl(TB45A.Value) / 128 * 1000000, 0) & " PPM"
End Sub]
Thanks for any help