ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Delete certain text from cells (https://www.excelbanter.com/excel-discussion-misc-queries/448092-delete-certain-text-cells.html)

ukat101052

Delete certain text from cells
 
I have a column of data (50 cells), with some cells blank. In certain of the cells, there is a dash that separates the first word in the cell, and the remaining letters/text (actually it is a blank/-/blank). I would like VBA that would delete everything after the first word in the cell (and this word can vary in length). Any ideas?
Thanks in advance.

Claus Busch

Delete certain text from cells
 
Hi,

Am Wed, 30 Jan 2013 18:12:03 +0000 schrieb ukat101052:

I have a column of data (50 cells), with some cells blank. In certain
of the cells, there is a dash that separates the first word in the cell,
and the remaining letters/text (actually it is a blank/-/blank). I
would like VBA that would delete everything after the first word in the
cell (and this word can vary in length). Any ideas?


home tab = Find & Select = Replace
Find what: blank-blank*
Replace with: Nothing


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

ukat101052

Thanks Claus-works beautifully!


All times are GMT +1. The time now is 05:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com