Hey hopefully someone can help me. I am trying to read some data that I cut and paste in from a database into a excel sheet. Base on the data outfall I want it to go do specfic sheets. But the problem is that the data has a extra space on the end from the database. I tried Trim,RTrim ,and LTrim, but for some reason the spaces is still there. well here the code.
[VBA]
Sub readcolumn(col,number)
Dim i As Variant
Dim j as Variant
i = 1
j = number
j =1
Do While cells.(i,j)<>""
col(i) = CVar(col(i))
col(i) = trim(col(i))
End If
i = i + 1
Loop
End Sub
[/VBA]
After I run this the space is still there and with the space excel can't see it the same one as the other on with space and dosent put it where i need it. So if anybody can help,I would be greatful, Thanks. I attaced the a column with the data if that help hopefully it will. Thanks bye.