Double quotes mistake in VBA

Ricardo Caicedo

New Member
Joined
Aug 21, 2014
Messages
43
I got a CSV file and when I extract the info (Into a variable array named w), I got double quotes(") two times so i.e. instead of "48.8" i got ""48.8"", so I tried to eliminate the double " with the function VBA Replace, but because the character that is used for split the function is the same char (") the program gave me a syntax error.

So I got the following:

Dim Temp as String

Code....
.....
........
w = Split(Data, ",")
EndFile = w(0)
If Count = 4 Then
Temp = Replace(w(5), """, " ")
End If

More Code.........

Any sugestions
 

Some videos you may like

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,770
Office Version
  1. 2010
Platform
  1. Windows
Need some more quotes to reduce the pairs of double quotes to a single double quote:

Code:
Temp = Replace(w(5), """""", """")

Not sure why you want any quotes in the string variable, though.
 

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,770
Office Version
  1. 2010
Platform
  1. Windows
You're welcome.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,205
Messages
5,527,399
Members
409,760
Latest member
zeeshansyed

This Week's Hot Topics

Top