Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro/function that keeps in a cell a given number of characters
Many columns , many cells . Some with text ( including numbers , empty spaces etc ) some with no content . I need a macro that keeps in a cell a given number of characters ( the first 5 or first 10 characters ) and delets the rest Example : I need the macro function to keep the first 11 characters A1 : Mommy and daddy went home The result should be : A1: Mommy and d -- andrei ------------------------------------------------------------------------ andrei's Profile: http://www.thecodecage.com/forumz/me...hp?userid=1056 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=148346 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro/function that keeps in a cell a given number of characters
Truncate to 5, 10 or 11 characters?
How do you choose? For your example................. Sub trunc() With ActiveCell If Len(.Value) 11 Then .Value = Left(.Value, 11) End If End With End Sub Gord Dibben MS Excel MVP On Tue, 27 Oct 2009 17:14:06 +0000, andrei wrote: Many columns , many cells . Some with text ( including numbers , empty spaces etc ) some with no content . I need a macro that keeps in a cell a given number of characters ( the first 5 or first 10 characters ) and delets the rest Example : I need the macro function to keep the first 11 characters A1 : Mommy and daddy went home The result should be : A1: Mommy and d |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Number of characters in a cell for a Index/match function | Excel Worksheet Functions | |||
Function to show the greatest number of characters | Excel Worksheet Functions | |||
Keep specified number of characters at end of cell? | Excel Worksheet Functions | |||
Max number of characters in a cell | Excel Discussion (Misc queries) | |||
Is there a rule for number of variables and characters used in a function | Excel Programming |