Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro which searches for a character . When found delets what's be
I need a macro which searches cells . When it finds a given character ( in my
case the character needed is : ) , it delets all characters including the given character . Preferably it puts the result in same column Example : A1 mother:son A2 father The result should be A1 son A2 father It's ok if it puts the result in column B , no problem with that , but better in A column |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro which searches for a character . When found delets what's be
Andrei,
Take a look at the native text functions in Excel. Open the "Insert Function" dialog box, select the Text category, and read about the text functions. Pay attention to FIND/SEARCH, LEN, RIGHT, and LEFT. You'll be able to FIND ":" and return the characters to the RIGHT of ":". Best, Matthew Herbert "andrei" wrote: I need a macro which searches cells . When it finds a given character ( in my case the character needed is : ) , it delets all characters including the given character . Preferably it puts the result in same column Example : A1 mother:son A2 father The result should be A1 son A2 father It's ok if it puts the result in column B , no problem with that , but better in A column |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro which searches for a character . When found delets what's be
Hi,
Try this Sub stance() Dim Lastrow As Long Lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row Set MyRange = Range("A1:A" & Lastrow) For Each c In MyRange c.Value = Mid(c.Value, InStr(c.Value, ":") + 1) Next End Sub Mike "andrei" wrote: I need a macro which searches cells . When it finds a given character ( in my case the character needed is : ) , it delets all characters including the given character . Preferably it puts the result in same column Example : A1 mother:son A2 father The result should be A1 son A2 father It's ok if it puts the result in column B , no problem with that , but better in A column |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro which searches for a character . When found delets what's be
Hi,
in column B enter =MID(A1,SEARCH(":",A1)+1,256) then you can copy column B as value on top of column A and delete column B "andrei" wrote: I need a macro which searches cells . When it finds a given character ( in my case the character needed is : ) , it delets all characters including the given character . Preferably it puts the result in same column Example : A1 mother:son A2 father The result should be A1 son A2 father It's ok if it puts the result in column B , no problem with that , but better in A column |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro which searches for a character . When found delets what'
Thanks guys . The macro works beautiful . So does the function given by Eduard
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro that searches by first and last and enters id number | Excel Programming | |||
Help with Macro that searches a Range for specified information | Excel Programming | |||
Getting valid web searches and avoiding sites that contaminate web searches | New Users to Excel | |||
Need help -- a Macro that searches for string in a cell range? | Excel Programming | |||
Quickly search for and delete entire row if certain character is found | Excel Programming |