hello,
Can you help me to identify and solve my problem?
I have multiple textbox in userform and all of it was Vlookup to Combobox1. I arrange the format of each Textbox according to number, percentage and date.
it was all good but when i want to edit or change the value in textbox, it doesn't type accordingly or the same as the problem above.
What i would like to happen is VIEW and EDIT.
In View when I type the ID number of employee the textboxes get the value by using vlookup in the workbook cell (All good)
Code:
'FORMAT TO DATE
Private Sub TextBox17_Change()
TextBox17.Text = Format(TextBox17.Value, "dd-mmm-yy")
End Sub
'FORMAT TO PERCENTAGE
Private Sub TextBox18_Change()
TextBox18 = Format(TextBox18.Value, "0.00%")
End Sub
When Edit, "_Change()" cannot edit the previous value accordingly. I know that to edit accordingly i have to use "_Exit(ByVal Cancel As MSForms.ReturnBoolean)", but this cannot view the format as i wanted ("dd-mmm-yy" & "0.00%") when Vlookup is applied.
In short explanation, I want to view the value at txtboxes accordingly as formatted but can also edit the value accordingly.
Hope you can help me
ShenYee
Can you help me to identify and solve my problem?
I have multiple textbox in userform and all of it was Vlookup to Combobox1. I arrange the format of each Textbox according to number, percentage and date.
it was all good but when i want to edit or change the value in textbox, it doesn't type accordingly or the same as the problem above.
What i would like to happen is VIEW and EDIT.
In View when I type the ID number of employee the textboxes get the value by using vlookup in the workbook cell (All good)
Code:
'FORMAT TO DATE
Private Sub TextBox17_Change()
TextBox17.Text = Format(TextBox17.Value, "dd-mmm-yy")
End Sub
'FORMAT TO PERCENTAGE
Private Sub TextBox18_Change()
TextBox18 = Format(TextBox18.Value, "0.00%")
End Sub
When Edit, "_Change()" cannot edit the previous value accordingly. I know that to edit accordingly i have to use "_Exit(ByVal Cancel As MSForms.ReturnBoolean)", but this cannot view the format as i wanted ("dd-mmm-yy" & "0.00%") when Vlookup is applied.
In short explanation, I want to view the value at txtboxes accordingly as formatted but can also edit the value accordingly.
Hope you can help me
ShenYee