ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Truncate Cell text all the time (https://www.excelbanter.com/excel-programming/344012-truncate-cell-text-all-time.html)

[email protected]

Truncate Cell text all the time
 
I have the need to trucate the contents of my cells regardless of
whether or not there is content in the adjoining cell. Can anyone tell
me how to do this?


Chip Pearson

Truncate Cell text all the time
 
You could use code like the following:

Dim Rng As Range
For Each Rng In Range("A1:A10")
If Len(Rng(1,2).Text) < 0 Then
Rng.Value = Left(Rng.Text,3) ' truncate to 3
characters
End If
Next Rng


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com





wrote in message
ups.com...
I have the need to trucate the contents of my cells regardless
of
whether or not there is content in the adjoining cell. Can
anyone tell
me how to do this?





All times are GMT +1. The time now is 10:23 PM.

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