Text formatting

G

Guest

Want macro that will work on a range I select that will look at the contents,
if apostrophe at beginning then no action, if not, it will add so cell
contents are formatted text.
THX
 
D

Dave D-C

Scottie,
This should be a start:

Sub Sub1()
Dim s1$, zCell As Range
For Each zCell In Selection
If zCell.PrefixCharacter <> "'" Then
s1 = zCell.Value
zCell.Value = "'" & s1
End If
Next zCell
End Sub ' D-C Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top