Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I need to trim a series of cells so they only contain 241 characters. Does
anyone have any VBA code to make this quick and easy? It needs to be the 1st 241 characters, everything else after that can be deleted however i don't think i can use an =Right or =Trim to my knowledge as the amount of characters in the cell isn't always the same (Anywhere between 40 & 390characters). |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
It doesn't matter if there are less than 241 characters, this works myvalue = Left(myvalue, 241) Mike "N1KO" wrote: I need to trim a series of cells so they only contain 241 characters. Does anyone have any VBA code to make this quick and easy? It needs to be the 1st 241 characters, everything else after that can be deleted however i don't think i can use an =Right or =Trim to my knowledge as the amount of characters in the cell isn't always the same (Anywhere between 40 & 390characters). |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Wed, 11 Feb 2009 04:37:19 -0800, N1KO
wrote: I need to trim a series of cells so they only contain 241 characters. Does anyone have any VBA code to make this quick and easy? It needs to be the 1st 241 characters, everything else after that can be deleted however i don't think i can use an =Right or =Trim to my knowledge as the amount of characters in the cell isn't always the same (Anywhere between 40 & 390characters). What about =left(a1,241) You could put that in a helper column, fill down, then copy/paste-values to get rid of the formula and also replace the original. --ron |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Feb 11, 5:37*am, N1KO wrote:
I need to trim a series of cells so they only contain 241 characters. Does anyone have any VBA code to make this quick and easy? It needs to be the 1st 241 characters, everything else after that can be deleted however i don't think i can use an =Right or =Trim to my knowledge as the amount of characters in the cell isn't always the same (Anywhere between 40 & 390characters). I beleive this should work =IF(LEN(A1)241,LEFT(A1,241),A1) |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"Oh Ya!, that's right what Mike said" , I replied foolishly
|
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
If you go for a worksheet solution then there's no need to test if the string is 241 long with an IF =left(a1,241) is sufficient even for shorter strings. Mike "CurlyDave" wrote: "Oh Ya!, that's right what Mike said" , I replied foolishly |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Feb 11, 6:10*am, Mike H wrote:
Hi, If you go for a worksheet solution then there's no need to test if the string is 241 long with an IF =left(a1,241) is sufficient even for shorter strings. Mike "CurlyDave" wrote: "Oh Ya!, that's right what Mike said" , I replied foolishly ......"Oh Ya!, that's right what Mike said" , I replied foolishly........ I was agreeing with you, I couldn't believe I didn't think of it. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Simple problem, simple formula, no FUNCTION ! | Excel Worksheet Functions | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
trim | New Users to Excel | |||
Make it more simple or intuitive to do simple things | Charts and Charting in Excel |