View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Excel VBA - Searching long words

sStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw xyz"
sStr1 = Left(sStr,31)
? sStr
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx yz
? sStr1
ABCDEFGHIJKLMNOPQRSTUVWXYZabcde


--
Regards,
Tom Ogilvy

"ozcank " wrote in message
...
Good thinking, I neglected that small factor. I have the following code,
which selects the name of the cell:

Private Sub getNames()
Dim intRow As Integer, wsMain As Worksheet
Dim strReadName As String

Set wsMain = ActiveWorkbook.Worksheets("ufioverdue")
intIdx = 0
intRow = 2
With wsMain
Do
strReadName = .Cells(intRow, 2)
strNames(intIdx) = strReadName

Do
intRow = intRow + 1
Loop Until strReadName < .Cells(intRow, 2)

intIdx = intIdx + 1

Loop While .Cells(intRow, 2) < ""
End With
intIdx = intIdx - 1

End Sub

What would I have to alter so that it would only select the first 31
characters of a cell? ny ideas?

Cheers


---
Message posted from http://www.ExcelForum.com/