View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Simon G
 
Posts: n/a
Default How do I remove leading apostrophes in Excel?

Hi Andrew
I am no programmer, but have copied and mixed the following code which,
unfortunatly, does not work. I would be grateful if you could check that
this is what you meant?

Sub DoAllWorksheets()
Dim ws As Worksheet
Dim rCell As Range
For Each ws In ActiveWorkbook.Worksheets
For Each rCell In ActiveSheet.UsedRange
If rCell.PrefixCharacter = "'" Then
rCell.Value = rCell.Value
End If
Next rCell
Next
End Sub


"Andrew Taylor" wrote:

Sub DoAllWorksheets()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
' delete apostrophes in ws using previous methods
Next
End Sub

Simon G wrote:
This works well, but is it possible to delete the apostrophes from all sheets
in a workbook?

"David" wrote:

?B?ZmhhYmVybGFuZA==?= wrote

I had the same problem. They way I solve it was a bit different, but
quick.

Norman Jones offered this earlier this year:
Sub DeleteApostrophes()
Dim rCell As Range
For Each rCell In ActiveSheet.UsedRange
If rCell.PrefixCharacter = "'" Then
rCell.Value = rCell.Value
End If
Next rCell
End Sub

Also very quick

--
David