#1   Report Post  
Jeff
 
Posts: n/a
Default Adding an apostrophe

I need help to run a formula that would replace the value of the cells
K10:K500 by adding an apostrophe €˜ in each row in column K

Example row K9: is 01/20/2005 needs to be €˜01/20/2005.

Regards,

  #2   Report Post  
Jim Rech
 
Posts: n/a
Default

A formula cannot change other cells, it just returns a result to the cell it
is in. Maybe you meant a macro? This works on the range selected .

Sub DoConvertToText()
Dim Cell As Range
Dim Counter As Long
''Special cell works on the entire current region if only one cell is
selected
If Selection.Cells.Count = 1 Then
If ActiveCell.Value < "" And Left(ActiveCell.Formula, 1) < "="
Then
ActiveCell.Value = "'" & ActiveCell.Value
MsgBox "One cell converted to text"
End If
Else
On Error GoTo NoCells
For Each Cell In Selection.SpecialCells(xlCellTypeConstants)
Cell.Value = "'" & Cell.Value
Counter = Counter + 1
Next
MsgBox Counter & " cells were converted to text"
End If
Exit Sub
NoCells:
MsgBox "No cells with constants were found"
End Sub

--
Jim Rech
Excel MVP
"Jeff" wrote in message
...
|I need help to run a formula that would replace the value of the cells
| K10:K500 by adding an apostrophe ' in each row in column K
|
| Example row K9: is 01/20/2005 needs to be '01/20/2005.
|
| Regards,
|


  #3   Report Post  
CLR
 
Posts: n/a
Default

With your present dates in K1:K500, use a helper column , say column J and
put this formula in J10 and copy down.........then do Copy PasteSpecial
Values on column J and then copy and paste it over to column K to replace
your dates without the apostrophe.

="'"&MONTH(K10)&"/"&DAY(K10)&"/"&YEAR(K10)

Vaya con Dios,
Chuck, CABGx3


"Jeff" wrote in message
...
I need help to run a formula that would replace the value of the cells
K10:K500 by adding an apostrophe ' in each row in column K

Example row K9: is 01/20/2005 needs to be '01/20/2005.

Regards,



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
Cell has an apostrophe and is text Carole O Excel Discussion (Misc queries) 2 March 3rd 05 08:09 PM
Adding contents of one cell to a range of cells. CLJinVA Excel Worksheet Functions 1 February 10th 05 10:19 PM
Delete apostrophe Susana Conklin via OfficeKB.com Excel Discussion (Misc queries) 2 December 3rd 04 08:15 PM
adding only positive numbers Jacob Excel Discussion (Misc queries) 2 November 30th 04 12:24 AM
Add apostrophe Tony Wainwright Excel Worksheet Functions 4 October 29th 04 01:50 PM


All times are GMT +1. The time now is 04:51 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"