Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,276
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro that searches by first and last and enters id number jcontrer Excel Programming 2 November 30th 07 07:40 PM
Help with Macro that searches a Range for specified information edluver Excel Programming 7 February 20th 07 07:31 PM
Getting valid web searches and avoiding sites that contaminate web searches David McRitchie New Users to Excel 1 June 13th 06 03:00 AM
Need help -- a Macro that searches for string in a cell range? graphicGuy Excel Programming 1 April 18th 06 05:53 PM
Quickly search for and delete entire row if certain character is found bkbri Excel Programming 2 December 14th 03 05:20 PM


All times are GMT +1. The time now is 08:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"