Question : how to delete partial contents of a cell?

I'm trying to clean up data in a spreadsheet before I import it into a database. But I can't figure out how to delete a portion of a cell's contents, and don't know what to look up in a book's index.

For example, if a cell includes the text "called in" I want to delete those words. But those words could be anywhere within the cell. I want to do this in vb code, because I'm using code to find those words and write them in a different cell if they exist.

Can anyone help? Thanks!

Answer : how to delete partial contents of a cell?

Then replace this line...

If InStr(1, cell.Value, "called in", vbTextCompare) > 0 Then cell.Value = ""

with this...

If InStr(1, cell.Value, "called in", vbTextCompare) > 0 Then cell.Value = Replace(cell.Value, "called in", "")

Saurabh....

Random Solutions  
 
programming4us programming4us