ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text formatting (https://www.excelbanter.com/excel-programming/400928-text-formatting.html)

Scottie

Text formatting
 
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

Dave D-C[_3_]

Text formatting
 
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

Scottie wrote:
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



----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


All times are GMT +1. The time now is 04:36 PM.

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