How to restrict the length of a string to a fixed length

tmd63

New Member
Joined
Feb 21, 2014
Messages
34
I want to have 2 cells with any length text in both.
I want some VBA code to combine and modify a third text box with a fixed length string that has a fixed length (say 8 characters) and the output characters can contain upper, lower case characters , numbers and special characters by return.
And the entry text fields can contain extra characters and numbers like those used in a website field.
However, the output text/numbers MUST be repeatable with the same entry fields.
So for example [www.mrexcel.com/board/forums/excel-questions] and [test01] always returns [DgT%£Hg38].
The first and second fields can be any length, but the third field MUST always be a fixed length of say 8 or 12 characters, but even smaller fields of [mrexcel] and [test01] returns 8 characters ([E4%hTf7i]) for example (note this time the fields are 7 and 6 characters long but the output field is 8 characters).
But each entry is not stored and the fields give a different output, but only if there is a different string used (not a random number generation)!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,144,388
Messages
5,724,070
Members
422,533
Latest member
garganod1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top