View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernd P Bernd P is offline
external usenet poster
 
Posts: 806
Default Numbers of repeats of a string

Hello Luciano,

The runtime depends heavily on the length of your strings and the
length of the substrings. If you can live with limited substrings
(length shorter than a certain threshold) then you can reduce the
runtime substantially.

Change the line in GenSubStrings
For i = 2 To Len(s) - 1
to
For i = 2 To worksheetfunction.min(10,Len(s) - 1)
for example.

The formula I gave you referred to A1. So your input is expected to be
in A1. Do you need this to be changed?

Regards,
Bernd