View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
asmenut asmenut is offline
external usenet poster
 
Posts: 59
Default Removing characters

I have the following code that takes a collection and send it to a string
then loads the string onto a spreadsheet.

'Add the Bulletin types, reasons and signatures required to their perspective
'strings and load onto the EO_Cover sheet
'First the Bulletin type
For x = 1 To Btype.Count
If Btype.Count < 0 Then
BTstr = BTstr & Btype(x) & " / "
Else
BTstr = BTstr & Btype(x)
End If
Next x
Range("C39") = BTstr

The problem is that when I come to the last item in the collection (list), I
need the " / " to come off. I have tried coding this like a Listbox (see
below)

For x = 1 To Btype.Count -1
If Btype.Count < 0 Then
BTstr = BTstr & Btype(x) & " / "
Else
BTstr = BTstr & Btype(x)
End If
But to no avail. I think it has to do with a listindex, but not sure. Is
there a way (other than searching from the right and removing the character)
that I can remove the ""/" prior to loading the sheet?

Thanks in advance