View Single Post
  #23   Report Post  
Posted to microsoft.public.excel.programming
Robert Crandal[_3_] Robert Crandal[_3_] is offline
external usenet poster
 
Posts: 161
Default Fast way to truncate string

"Claus Busch" wrote:

drag vData and sClean into the watch window and step with F8 through
your code.
What about the borders? Are there 20 asterix as in the question before?
Then try:
strSplit = Application.Rept("*", 20)
vData = Split(ReadTextFile(sFile1), String(80,strSplit))


I have been testing different border sizes, such as 20 and 80. I
didn't think this would affect the code because the Split() function
discards the borders and only stores each inner string into an
array.

The main data types being used in my code are variant, array, and
string. It seems there is a problem with the data types being passed into
the TruncateString() function, but I'm not sure.