Copy only the first 5 characters of a userform field to a database?

KristenB

New member
Joined
Jan 2, 2020
Messages
35
Reaction score
0
Points
0
Excel Version(s)
365
I am attempting to move code to a database from my userform and all of my data is transferring perfect including this one, however, I just added the limitation of only moving the first 5 characters and apparently I didn't do it correctly as I am getting an error. :( Could someone help me understand where I want the 'Left(Cell.value, 5)' coding to make this work? I thought I had it right but apparently not. :( Thank you for any help someone can give. :)



Sheets("Travel Expense Codes").Range("DataStartCodes").Offset(CodesTargetRow, 11).value = Left(Cell.value, 5) = cmbOtherExpenseCode
 
A guess:
Sheets("Travel Expense Codes").Range("DataStartCodes").Offset(CodesTargetRow, 11).value = Left(cmbOtherExpenseCode, 5)
but if this doesn't work, give the code that worked but sent the whole string across.
 
Back
Top