ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Characters Object limitation? (https://www.excelbanter.com/excel-programming/297277-characters-object-limitation.html)

nguy0531

Characters Object limitation?
 
I use this code to delete the first character in the cell.
*ActiveCell.Characters(1, 1).Delete* If the length of the cell conten
is less than 256 characters then the first character get deleted.
However, if the length is more than 256 characters then the firs
character is not deleted. Is there a limitation on the character
object? Is there any way I can delete the character when the lengt
is longer than 256 characters? Thanks for you hel

--
Message posted from http://www.ExcelForum.com


Paul Robinson

Characters Object limitation?
 
Hi
Rather than delete the first character, try replacing the string in
the cell with everything after the first character.

myString = ActiveCell.Text
ActiveCell.Value = Right(myString, Len(myString) - 1)

Works in Excel2002 under XP

regards
Paul

nguy0531 wrote in message ...
I use this code to delete the first character in the cell.
*ActiveCell.Characters(1, 1).Delete* If the length of the cell content
is less than 256 characters then the first character get deleted.
However, if the length is more than 256 characters then the first
character is not deleted. Is there a limitation on the characters
object? Is there any way I can delete the character when the length
is longer than 256 characters? Thanks for you help


---
Message posted from http://www.ExcelForum.com/



All times are GMT +1. The time now is 07:28 AM.

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