ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Removing Single quite (') in character data (https://www.excelbanter.com/excel-programming/353282-removing-single-quite-character-data.html)

[email protected]

Removing Single quite (') in character data
 
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.


Bob Phillips[_6_]

Removing Single quite (') in character data
 
Do it manually with the macro recorder on (ToolsMacroRecord New Macro...)
and you will get some code.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
ups.com...
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.




Dave Peterson

Removing Single quite (') in character data
 
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


wrote:

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.


--

Dave Peterson


All times are GMT +1. The time now is 04:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com