Removing Single quite (') in character data

V

vpidatala

Hi,

I have a SQL DTS package exporting data from SQL server to Excel. When
the data is exported to excel, each cell other with character data has
a single quote and some spaces followed by actual data.

I figured out that I can copy the entire sheet and pasting with paste
special with values radio button selected in an other sheet is giving
me clean data.

I am totally new to excel programming. Will some one please let me know
how can I write a Macro to create an other excel file and then copy
each sheet from my excel file and paste using paste special with
"values" radio button selected into the new file.

My original excel file has 6 sheets with lots of data in each.

Thanks in advance.
 
B

Bob Phillips

Do it manually with the macro recorder on (Tools>Macro>Record New Macro...)
and you will get some code.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
D

Dave Peterson

Maybe just updating in place would be easier:

Option Explicit
Sub testme()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
With wks.UsedRange
.Value = .Value
End With
Next wks
End Sub

or

Option Explicit
Sub testme2()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
With wks.UsedRange
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
Next wks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top