Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Claus,
Nothing is carried out when running your code. I will try to explain in example what I want the macro to do. If a word in a cell has 10 characters no action should be taken If a word in a cell has less than 10 characters no action should be taken If a word in a cell has e.g.12 characters - two characters from the end shall be removed If a word in a cell has e.g. 20 characters - 10 characters from the end shall be removed In other words - no matter how many characters is in the word I always want to end up with a word consisting of only ten characters. Hope this information can help to find a solution. Best regards, Kaj Pedersen "Claus Busch" skrev i en meddelelse ... Hi Kaj, Am Tue, 11 Oct 2011 16:05:05 +0200 schrieb KP: In order to start the deletion of characters from the end of the word I changed "Right" to "Left", but the code is not able to deal with words containing e.g. 12 characters in which case I want only the last two characters to be deleted. try: Set myRange = Range("A1:B20") For Each rngC In myRange If Len(rngC) 10 Then If IsNumeric(rngC) Then rngC = Left(rngC, 10) * 1 Else rngC = Left(rngC, 10) End If End If Next Regards Claus Busch -- Win XP PRof SP2 / Vista Ultimate SP2 Office 2003 SP2 /2007 Ultimate SP2 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete characters at the end | Excel Discussion (Misc queries) | |||
delete non numberic characters | Excel Discussion (Misc queries) | |||
Delete first few cell characters | Excel Discussion (Misc queries) | |||
delete all the cell that contains more than 25 characters | Excel Discussion (Misc queries) | |||
Delete characters | Excel Programming |