Kristen_cancerkiller
Member
Hello,
I am working on a userform and database. In my userform I have several fields that the info is then moved to the database. One field in particular is a 'selection' field where the user chooses one of 3 options. Each of those options begins with 5 digits that I need to copy to my database but all of the characters in the selection field are necessary for the user. How do I move only the first 5 digits to my userform using vba code? My code string is below:
Sheets("Travel Expense Voucher").Range("Data_Start").Offset(TargetRow,11.Value=cmbMileageRates
I know that this can be done in a spreadsheet by selecting the field, say B1, and using the following formula: =Left(B1,5) but I am unsure where to put that into my vba to make it happen since I am not using excel fields to enter the code. Please help?
I am working on a userform and database. In my userform I have several fields that the info is then moved to the database. One field in particular is a 'selection' field where the user chooses one of 3 options. Each of those options begins with 5 digits that I need to copy to my database but all of the characters in the selection field are necessary for the user. How do I move only the first 5 digits to my userform using vba code? My code string is below:
Sheets("Travel Expense Voucher").Range("Data_Start").Offset(TargetRow,11.Value=cmbMileageRates
I know that this can be done in a spreadsheet by selecting the field, say B1, and using the following formula: =Left(B1,5) but I am unsure where to put that into my vba to make it happen since I am not using excel fields to enter the code. Please help?