Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I would like to be able to delete some characters from some cells. I want to look for 4 spaces, then delete everything after (and including) the 4 spaces. This is probably staring me in the face Thanks. -- PLPE ------------------------------------------------------------------------ PLPE's Profile: http://www.excelforum.com/member.php...o&userid=23856 View this thread: http://www.excelforum.com/showthread...hreadid=384473 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() =IF(ISERR(LEFT(A1,FIND(" ",A1)-1)),A1,LEFT(A1,FIND(" ",A1)-1)) considering your test is in A1. Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=384473 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you are looking for a VBA solution:
Sub ProcStrings() Dim cell as Range, iloc as Long for each cell in selection iloc = instr(1,cell.Value, " ",vbTextCompare) if iloc 1 then cell.Value = Left(cell.Value,iloc-1) else cell.Value = Trim(cell.Value) end if Next End sub -- Regards, Tom Ogilvy "PLPE" wrote in message ... Hi, I would like to be able to delete some characters from some cells. I want to look for 4 spaces, then delete everything after (and including) the 4 spaces. This is probably staring me in the face Thanks. -- PLPE ------------------------------------------------------------------------ PLPE's Profile: http://www.excelforum.com/member.php...o&userid=23856 View this thread: http://www.excelforum.com/showthread...hreadid=384473 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() brilliant, thanks to both of you for your help. I'll be going with the VB code. -- PLPE ------------------------------------------------------------------------ PLPE's Profile: http://www.excelforum.com/member.php...o&userid=23856 View this thread: http://www.excelforum.com/showthread...hreadid=384473 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I've tried the VB code, but to no avail. I now want to look for 2 consecutive spaces. When they are found, I want to delete them & everything following after. I'd prefere to do this using code, rather than a cell formula - I'll have formulae in the cells at a later stage. any ideas? -- PLPE ------------------------------------------------------------------------ PLPE's Profile: http://www.excelforum.com/member.php...o&userid=23856 View this thread: http://www.excelforum.com/showthread...hreadid=384473 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting LF Characters in cells | Excel Worksheet Functions | |||
Deleting Characters | Excel Discussion (Misc queries) | |||
Deleting rows with 11+ characters. | Excel Worksheet Functions | |||
Deleting rows with 11+ characters. | Excel Discussion (Misc queries) | |||
Deleting non numeric characters. | Excel Programming |