I'm trying to find the fastest way to do this. I've written a function where you input a string of numbers and it takes the first 2 characters and repeats them until the new string has the same length of the input string.
So input = 56378, output = 56565. Input=89432, output=89898
This is what I have now:Can you guys think of anything faster?Code:Private Function Alternate(Num As String) As String Dim first(0 To 1) As String, x As Long first(1) = Mid$(Num, 1, 1) first(0) = Mid$(Num, 2, 1) For x = 1 To Len(Num) Alternate = Alternate & first(x Mod 2) Next x End Function




Reply With Quote