View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Michael Malinsky[_3_] Michael Malinsky[_3_] is offline
external usenet poster
 
Posts: 45
Default If (starts with ', then delete the ')

Apparently replacing the cell value with itself elimiates the apostrophe:

Sub nomoreapos()

For Each c In Selection
c.Value = c.Value
Next c

End Sub

wrote in message
oups.com...
This is not working. Len is ignoring the apostrophe when determining
the length so this function is deleting the first number in the cell.
Any other ideas? Thank you for your help.

Don Guillett wrote:
one way?
Sub nomoreapos()
For Each c In Selection
c.Value = Right(c, Len(c) - 1)
Next c

--
Don Guillett
SalesAid Software

wrote in message
oups.com...
Gentlemen (and Ladies),

Unfortunately the last person who did this job entered dates with a

"'"
in front of all of them, and excel will not recognize them as

dates.
I'm looking for some code that will do the following:

rownum = 7

Do
if Range("P" & rownum).Value [begins with "'"] then
[delete the "'"]
rownum = rownum + 1
Does anybody know how to do something like this?