keith05281967
Board Regular
- Joined
- May 6, 2011
- Messages
- 68
Greetings VBA wizards,
I'm trying to remove a comma if found at the end of a string. I think i'm really close but I don't have the syntax exactly right. Can you offer some advice?
So an example would be - HOUSTON, to HOUSTON
pretty simple right?
Code:
For i = 2 To lastrow
s = Cells(i, ColumnNumber).Value
s = Trim(s)
If (Right(s, 1)) = "," Then
left(s,len(s)-1),s) <---this is the offending line
End If
Next i
thanks, excel 07. looking for a vba solution
I'm trying to remove a comma if found at the end of a string. I think i'm really close but I don't have the syntax exactly right. Can you offer some advice?
So an example would be - HOUSTON, to HOUSTON
pretty simple right?
Code:
For i = 2 To lastrow
s = Cells(i, ColumnNumber).Value
s = Trim(s)
If (Right(s, 1)) = "," Then
left(s,len(s)-1),s) <---this is the offending line
End If
Next i
thanks, excel 07. looking for a vba solution