Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default How can I get rid of the ' single quote in Excel Worksheet

Dear all,

I am not sure if I am posting my question in the right page, I hope someone
can help me out.
I used the DTS package in SQL server to put a table's data on an Excel
worksheet. However, I discover that a single quote " ' " is placed in front
of the values in every cell. This makes the calculation or format change
cannot be carried out. How can I get rid of the single quote? I am so
frustrated.
Thanks.

Ivan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How can I get rid of the ' single quote in Excel Worksheet

Hi Ivan,

Try:

'===============
Public Sub Tester001()
Dim rng As Range
Dim rCell As Range
Dim WB As Workbook
Dim SH As Worksheet

Set WB = ActiveWorkbook '<<======= CHANGE
Set SH = WB.Sheets("Sheet1") '<<======= CHANGE
Set rng = SH.Range("A1:D20") '<<======= CHANGE

For Each rCell In rng.Cells
With rCell
If IsNumeric(.Value) Then
.Value = .Value
End If
End With
Next rCell

End Sub
'<<===============


---
Regards,
Norman



"Ivan" wrote in message
...
Dear all,

I am not sure if I am posting my question in the right page, I hope
someone
can help me out.
I used the DTS package in SQL server to put a table's data on an Excel
worksheet. However, I discover that a single quote " ' " is placed in
front
of the values in every cell. This makes the calculation or format change
cannot be carried out. How can I get rid of the single quote? I am so
frustrated.
Thanks.

Ivan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How can I get rid of the ' single quote in Excel Worksheet

Hi Ivan,

Or, perhaps preferable would be:
'===============
Public Sub Tester002()
Dim rng As Range
Dim rCell As Range
Dim WB As Workbook
Dim sh As Worksheet

Set WB = ActiveWorkbook '<<======= CHANGE
Set sh = WB.Sheets("Sheet1") '<<======= CHANGE
Set rng = sh.Range("A1:D20") '<<======= CHANGE

For Each rCell In rng.Cells
With rCell
If .PrefixCharacter = "'" Then
.Formula = .Value
End If
End With
Next rCell

End Sub
'<<===============


---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Ivan,

Try:

'===============
Public Sub Tester001()
Dim rng As Range
Dim rCell As Range
Dim WB As Workbook
Dim SH As Worksheet

Set WB = ActiveWorkbook '<<======= CHANGE
Set SH = WB.Sheets("Sheet1") '<<======= CHANGE
Set rng = SH.Range("A1:D20") '<<======= CHANGE

For Each rCell In rng.Cells
With rCell
If IsNumeric(.Value) Then
.Value = .Value
End If
End With
Next rCell

End Sub
'<<===============


---
Regards,
Norman



"Ivan" wrote in message
...
Dear all,

I am not sure if I am posting my question in the right page, I hope
someone
can help me out.
I used the DTS package in SQL server to put a table's data on an Excel
worksheet. However, I discover that a single quote " ' " is placed in
front
of the values in every cell. This makes the calculation or format change
cannot be carried out. How can I get rid of the single quote? I am so
frustrated.
Thanks.

Ivan





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default How can I get rid of the ' single quote in Excel Worksheet

select all of the cells and do a find and replace for ' and replace with ""
(that's 2 double quotes).

--


Gary


"Ivan" wrote in message
...
Dear all,

I am not sure if I am posting my question in the right page, I hope
someone
can help me out.
I used the DTS package in SQL server to put a table's data on an Excel
worksheet. However, I discover that a single quote " ' " is placed in
front
of the values in every cell. This makes the calculation or format change
cannot be carried out. How can I get rid of the single quote? I am so
frustrated.
Thanks.

Ivan



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
How to read a string in excel and include the single quote Ricky Excel Discussion (Misc queries) 3 September 4th 09 04:46 PM
Remove single quote Avadivelan TCS Excel Worksheet Functions 4 October 5th 06 03:48 PM
How can I get rid of the ' single quote sign in excel worksheet Ivan Excel Worksheet Functions 5 October 21st 05 05:35 AM
adding a single quote and comma to every cell in Excel rodsheffield Excel Programming 3 October 4th 05 08:17 PM
Removing single quote from an excel sheet Hari Excel Discussion (Misc queries) 2 December 3rd 04 09:53 PM


All times are GMT +1. The time now is 03:09 AM.

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

About Us

"It's about Microsoft Excel"