ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Remove punctuation mark ' (https://www.excelbanter.com/excel-programming/433364-remove-punctuation-mark.html)

Sal

Remove punctuation mark '
 
This punctuation mark ' appears before every word in every row of column A.
Each row only has one word. I tried removing the punctuation mark ' using
the Replace function from the Edit menu. I put replace what: ( ' ) / replace
with: (blank), but it didnt work. I also tried other options from the help
menu but they didnt work out well either.

Is there a code that will remove ' punctuation mark from every cell in
column A that has a word written in it?


Patrick Molloy[_2_]

Remove punctuation mark '
 
could you try
=MID(A1,2,LEN(A1) )

as the first chracter may not be a ' even though it appears to be.

"Sal" wrote:

This punctuation mark ' appears before every word in every row of column A.
Each row only has one word. I tried removing the punctuation mark ' using
the Replace function from the Edit menu. I put replace what: ( ' ) / replace
with: (blank), but it didnt work. I also tried other options from the help
menu but they didnt work out well either.

Is there a code that will remove ' punctuation mark from every cell in
column A that has a word written in it?


Patrick Molloy[_2_]

Remove punctuation mark '
 
no to my previious.
' was a LOTUS alignment control, and this meant left align

use =MID(A1,1,LEN(A1) )



"Sal" wrote:

This punctuation mark ' appears before every word in every row of column A.
Each row only has one word. I tried removing the punctuation mark ' using
the Replace function from the Edit menu. I put replace what: ( ' ) / replace
with: (blank), but it didnt work. I also tried other options from the help
menu but they didnt work out well either.

Is there a code that will remove ' punctuation mark from every cell in
column A that has a word written in it?


Gary''s Student

Remove punctuation mark '
 
If you want to remove them in place, select the cells and run:

Sub tickout()
Dim r As Range
For Each r In Selection
If r.PrefixCharacter = "'" Then
r.Value = r.Value
End If
Next
End Sub
--
Gary''s Student - gsnu200902


"Sal" wrote:

This punctuation mark ' appears before every word in every row of column A.
Each row only has one word. I tried removing the punctuation mark ' using
the Replace function from the Edit menu. I put replace what: ( ' ) / replace
with: (blank), but it didnt work. I also tried other options from the help
menu but they didnt work out well either.

Is there a code that will remove ' punctuation mark from every cell in
column A that has a word written in it?


Rick Rothstein

Remove punctuation mark '
 
Here is a non-looping method that I believe also works...

As a one-liner
=========================================
Selection.SpecialCells(xlTextValues Or xlCellTypeConstants).Value = _
Selection.SpecialCells(xlTextValues Or xlCellTypeConstants).Value

Same code "prettied up" for readability
=========================================
With Selection.SpecialCells(xlTextValues Or xlCellTypeConstants)
.Value = .Value
End With

--
Rick (MVP - Excel)


"Gary''s Student" wrote in message
...
If you want to remove them in place, select the cells and run:

Sub tickout()
Dim r As Range
For Each r In Selection
If r.PrefixCharacter = "'" Then
r.Value = r.Value
End If
Next
End Sub
--
Gary''s Student - gsnu200902


"Sal" wrote:

This punctuation mark ' appears before every word in every row of column
A.
Each row only has one word. I tried removing the punctuation mark '
using
the Replace function from the Edit menu. I put replace what: ( ' ) /
replace
with: (blank), but it didnt work. I also tried other options from the
help
menu but they didnt work out well either.

Is there a code that will remove ' punctuation mark from every cell in
column A that has a word written in it?



Rick Rothstein

Remove punctuation mark '
 
I think I used the wrong syntax. I believe my code should have been written
this way...

As a one-liner
=========================================
Selection.SpecialCells(xlCellTypeConstants, xlTextValues).Value = _
Selection.SpecialCells(xlTextValues Or xlCellTypeConstants).Value

Same code "prettied up" for readability
=========================================
With Selection.SpecialCells(xlCellTypeConstants, xlTextValues)
.Value = .Value
End With



--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
Here is a non-looping method that I believe also works...

As a one-liner
=========================================
Selection.SpecialCells(xlTextValues Or xlCellTypeConstants).Value = _
Selection.SpecialCells(xlTextValues Or xlCellTypeConstants).Value

Same code "prettied up" for readability
=========================================
With Selection.SpecialCells(xlTextValues Or xlCellTypeConstants)
.Value = .Value
End With

--
Rick (MVP - Excel)


"Gary''s Student" wrote in
message ...
If you want to remove them in place, select the cells and run:

Sub tickout()
Dim r As Range
For Each r In Selection
If r.PrefixCharacter = "'" Then
r.Value = r.Value
End If
Next
End Sub
--
Gary''s Student - gsnu200902


"Sal" wrote:

This punctuation mark ' appears before every word in every row of column
A.
Each row only has one word. I tried removing the punctuation mark '
using
the Replace function from the Edit menu. I put replace what: ( ' ) /
replace
with: (blank), but it didnt work. I also tried other options from the
help
menu but they didnt work out well either.

Is there a code that will remove ' punctuation mark from every cell in
column A that has a word written in it?





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

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