Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
removing duplicate data from a single list Brad Excel Worksheet Functions 1 October 7th 08 06:00 AM
Help removing "space" character from imported data smartgal Excel Discussion (Misc queries) 3 June 30th 08 07:38 PM
Removing a character sjs Excel Worksheet Functions 4 November 14th 07 09:29 PM
removing character from field adibranch Excel Worksheet Functions 8 May 26th 05 12:05 PM
Removing ' character from cells Don Excel Discussion (Misc queries) 5 December 21st 04 05:41 PM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"