Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Leading single quote

Excel puts a leading single quote in text cells when populated from SQL and
without recourse to Excel itself. I know that the single quote does not print.

1. Is there a way of preventing the single quote prefix from being used?
2. Is there a way of using Replace to remove the single quote?

The only way I have found of removing the single quote is by copying the
range & using Paste Special (Values): the range must be copied to a different
location. The single quote does not disappear when copied in the same place.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Leading single quote

Hi,
This worked for me:

Sub RemoveQuote()
Dim rng As Range, cell As Object
Set rng = Range("a1:a10")
For Each cell In rng
cell = Format(cell, "@")
Next cell

End Sub

HTH

"AA2e72E" wrote:

Excel puts a leading single quote in text cells when populated from SQL and
without recourse to Excel itself. I know that the single quote does not print.

1. Is there a way of preventing the single quote prefix from being used?
2. Is there a way of using Replace to remove the single quote?

The only way I have found of removing the single quote is by copying the
range & using Paste Special (Values): the range must be copied to a different
location. The single quote does not disappear when copied in the same place.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Leading single quote

Thanks. It does.

However, applying that format directly using the menu does not. Strange!

"Toppers" wrote:

Hi,
This worked for me:

Sub RemoveQuote()
Dim rng As Range, cell As Object
Set rng = Range("a1:a10")
For Each cell In rng
cell = Format(cell, "@")
Next cell

End Sub

HTH

"AA2e72E" wrote:

Excel puts a leading single quote in text cells when populated from SQL and
without recourse to Excel itself. I know that the single quote does not print.

1. Is there a way of preventing the single quote prefix from being used?
2. Is there a way of using Replace to remove the single quote?

The only way I have found of removing the single quote is by copying the
range & using Paste Special (Values): the range must be copied to a different
location. The single quote does not disappear when copied in the same place.

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
vlookup and using single quote Bishop Excel Worksheet Functions 2 April 3rd 09 06:02 PM
Remove single quote Avadivelan TCS Excel Worksheet Functions 4 October 5th 06 03:48 PM
Removing leading single quote (') from cells with Search/Replace Arun Excel Discussion (Misc queries) 3 January 22nd 06 03:40 AM
single quote 10-digit number that has leading zeroes & then conca. lorelei739 Excel Worksheet Functions 1 November 5th 04 12:02 AM
Single quote in a where clause Poh[_2_] Excel Programming 0 July 9th 04 02:54 AM


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

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"