27
13
I'm working with a number of data lists that are keyed by document name. The document names, while very descriptive, are quite cumbersome if I need to view them on (up to 256 bytes is a lot of real estate) and I'd love to be able to create a smaller keyfield that's readily reproducible in case I need to do a VLOOKUP
from another workseet or workbook.
I'm thinking a hash from the title that'd be unique and reproducible for each title would be most appropriate. Is there a function available, or am I looking at developing my own algorithm?
Any thoughts or ideas on this or another strategy?
1This is an excellent tool. – Jay Killeen – 2015-08-23T14:48:01.087
How large can the source data be and still retain 0% collision? – Vegard – 2016-03-31T09:45:11.427
I noticed this returns different values for duplicate files with different file names. Is there any way to check for the contents only – puk – 2017-04-17T21:18:34.367
I'ts a while ago, but the file is no longer available. can anyone make it available again? thanks. – otmezger – 2018-11-15T19:23:53.217
@otmezger Done. – nixda – 2018-11-16T16:23:59.673
1You can make the
cutoff
parameterized and optional with a different default by moving it up to the Function parameter listPublic Function BASE64SHA1(ByVal sTextToHash As String, Optional ByVal cutoff As Integer = 8)
and remove the declaration inside the function. – Core – 2019-03-07T22:08:46.0101Looks great. However, I don't have enough VBA experience to prevent Excel from returning
#NAME?
. View code > cut and paste code into new window -- within the correct worksheet in the navigator > save as macro-enabled worksheet > close and return to excel...anything else I'm missing? Do I need to compile it somehow? – dwwilson66 – 2013-02-13T16:09:10.410Yes...to clarify...i pasted it in the new code window that popped up when I went to worksheet tab > view code... Downloading the sample right now, but I would like to understand why excel doesnt recognize my code – dwwilson66 – 2013-02-13T16:54:02.717
WooHoo...the sample sheet helped. Realized I'd pasted the code into and excel OBJECT window, not a MODULE window. I'm getting hashes in my workbook now! – dwwilson66 – 2013-02-13T17:03:22.673