Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
1. How can I take a long selection of cells and remove in every case the last
character? Sub test1() Dim c As Range For Each c In Selection c.Value = Left(c.Value, Len(c.Value) - 1) Next c End Sub 2. Is there a way in a long selection of data I can eliminate all characters in a string to the left of or right of a single character or more usefully a common series of characters in a string? eg., if the word "Contact" appears in every string how can i get split the data so that everything before the word "Contact"is separated? Sub test2() Dim c As Range For Each c In Selection If c.Value Like "*Contact*" Then c.Value = Right(c.Value, Len(c.Value) - InStr(1, c.Value, "Contact") + 1) End If 'if instr(1,c.Value,contact = Left(c.Value, Len(c.Value) - 1) Next c End Sub HTH Daniel |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
REVERSE SINGLE CELL TEXT STRING | Excel Worksheet Functions | |||
Splitting data in a single cell that is seperated by commas, then moving to make individual rows | Excel Discussion (Misc queries) | |||
Splitting data out of a single cell | Excel Discussion (Misc queries) | |||
Splitting single column data into two | Excel Worksheet Functions | |||
Splitting a single cell | Excel Discussion (Misc queries) |