ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Marco that Delete Cells With Specific Text (https://www.excelbanter.com/excel-programming/404047-marco-delete-cells-specific-text.html)

Chuong Nguyen

Marco that Delete Cells With Specific Text
 
Please help - I need a macro to clean up a worksheet

Look for in column "A" the word "Created:" then when it is located (even
with the whole string) it will delete the whole cell

Column A
1 Orig ER: Emilio N. Francisco (emilioef)
2 Created: 1/6/2008 6:45:00 AM Scheduled: Yes
3 Eff Date: 01/08/2008 Conf#: 1G5863K App: CLKCCM
4 Recipient: SHIRLEY HEPBURN (4045656) Send Prenote: No
5 SHIRLEY HEPBURN
6 Orig CR: Emilio N. Francisco (emilioef)
7 Created: 1/7/2008 6:44:00 AM Scheduled: No
8 Eff Date: 01/08/2008 Conf#: 1G5861B App: CLKCCM
9 Recipient: DOUGLAS ANDERSON (4043211) Send Prenote: Yes
10 DOUGLAS ANDERSON
11 Orig BR: Emilio N. Francisco (emilioef)
12 Created: 1/5/2008 6:52:00 AM Scheduled: Yes
13 Eff Date: 01/08/2008 Conf#: 1G5862L App: CLKCCM
14 Recipient: JOHN ZALESKY (100274) Send Prenote: No
15 JOHN ZALESKY


Any help would be appreciated.

Chuong Nguyen



Rick Rothstein \(MVP - VB\)

Marco that Delete Cells With Specific Text
 
Does it have to be a macro? Select column A, click Edit/Find (or press Ctrl+F), type Created in the text field, click Find All, select all the rows in the list that is displayed (Ctrl+A will do that), Close the Find dialog and press Delete.

If it needs to be a macro, try this...

Sub ClearCreatedCells()
Dim X As Long
For X = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If InStr(Cells(X, "A").Value, "Created") Then Cells(X, "A").Value = ""
Next
End Sub

Rick


"Chuong Nguyen" wrote in message ...
Please help - I need a macro to clean up a worksheet

Look for in column "A" the word "Created:" then when it is located (even
with the whole string) it will delete the whole cell

Column A
1 Orig ER: Emilio N. Francisco (emilioef)
2 Created: 1/6/2008 6:45:00 AM Scheduled: Yes
3 Eff Date: 01/08/2008 Conf#: 1G5863K App: CLKCCM
4 Recipient: SHIRLEY HEPBURN (4045656) Send Prenote: No
5 SHIRLEY HEPBURN
6 Orig CR: Emilio N. Francisco (emilioef)
7 Created: 1/7/2008 6:44:00 AM Scheduled: No
8 Eff Date: 01/08/2008 Conf#: 1G5861B App: CLKCCM
9 Recipient: DOUGLAS ANDERSON (4043211) Send Prenote: Yes
10 DOUGLAS ANDERSON
11 Orig BR: Emilio N. Francisco (emilioef)
12 Created: 1/5/2008 6:52:00 AM Scheduled: Yes
13 Eff Date: 01/08/2008 Conf#: 1G5862L App: CLKCCM
14 Recipient: JOHN ZALESKY (100274) Send Prenote: No
15 JOHN ZALESKY


Any help would be appreciated.

Chuong Nguyen



Chuong Nguyen

Marco that Delete Cells With Specific Text
 
thanks so much



"Chuong Nguyen" wrote in message
...
Please help - I need a macro to clean up a worksheet

Look for in column "A" the word "Created:" then when it is located (even
with the whole string) it will delete the whole cell

Column A
1 Orig ER: Emilio N. Francisco (emilioef)
2 Created: 1/6/2008 6:45:00 AM Scheduled: Yes
3 Eff Date: 01/08/2008 Conf#: 1G5863K App: CLKCCM
4 Recipient: SHIRLEY HEPBURN (4045656) Send Prenote: No
5 SHIRLEY HEPBURN
6 Orig CR: Emilio N. Francisco (emilioef)
7 Created: 1/7/2008 6:44:00 AM Scheduled: No
8 Eff Date: 01/08/2008 Conf#: 1G5861B App: CLKCCM
9 Recipient: DOUGLAS ANDERSON (4043211) Send Prenote: Yes
10 DOUGLAS ANDERSON
11 Orig BR: Emilio N. Francisco (emilioef)
12 Created: 1/5/2008 6:52:00 AM Scheduled: Yes
13 Eff Date: 01/08/2008 Conf#: 1G5862L App: CLKCCM
14 Recipient: JOHN ZALESKY (100274) Send Prenote: No
15 JOHN ZALESKY


Any help would be appreciated.

Chuong Nguyen




Dave Peterson

Marco that Delete Cells With Specific Text
 
Another way if you really meant that you wanted to clear the contents of those
cells.

Record a macro when you:
Select column A
Edit|Replace
what: *Created:*"
with: (leave blank)
replace all



Chuong Nguyen wrote:

Please help - I need a macro to clean up a worksheet

Look for in column "A" the word "Created:" then when it is located (even
with the whole string) it will delete the whole cell

Column A
1 Orig ER: Emilio N. Francisco (emilioef)
2 Created: 1/6/2008 6:45:00 AM Scheduled: Yes
3 Eff Date: 01/08/2008 Conf#: 1G5863K App: CLKCCM
4 Recipient: SHIRLEY HEPBURN (4045656) Send Prenote: No
5 SHIRLEY HEPBURN
6 Orig CR: Emilio N. Francisco (emilioef)
7 Created: 1/7/2008 6:44:00 AM Scheduled: No
8 Eff Date: 01/08/2008 Conf#: 1G5861B App: CLKCCM
9 Recipient: DOUGLAS ANDERSON (4043211) Send Prenote: Yes
10 DOUGLAS ANDERSON
11 Orig BR: Emilio N. Francisco (emilioef)
12 Created: 1/5/2008 6:52:00 AM Scheduled: Yes
13 Eff Date: 01/08/2008 Conf#: 1G5862L App: CLKCCM
14 Recipient: JOHN ZALESKY (100274) Send Prenote: No
15 JOHN ZALESKY

Any help would be appreciated.

Chuong Nguyen


--

Dave Peterson

Rick Rothstein \(MVP - VB\)

Marco that Delete Cells With Specific Text
 
Sigh! What was I thinking! Here I gave this longish, convoluted mechanical procedure instead of the simple, direct procedure you posted. Sometimes I have to wonder about myself. My only hope is that the OP was after the macro solution and didn't notice.<g Anyway, thanks for following up this thread with your posting.

Rick


"Dave Peterson" wrote in message ...
Another way if you really meant that you wanted to clear the contents of those
cells.

Record a macro when you:
Select column A
Edit|Replace
what: *Created:*"
with: (leave blank)
replace all



Chuong Nguyen wrote:

Please help - I need a macro to clean up a worksheet

Look for in column "A" the word "Created:" then when it is located (even
with the whole string) it will delete the whole cell

Column A
1 Orig ER: Emilio N. Francisco (emilioef)
2 Created: 1/6/2008 6:45:00 AM Scheduled: Yes
3 Eff Date: 01/08/2008 Conf#: 1G5863K App: CLKCCM
4 Recipient: SHIRLEY HEPBURN (4045656) Send Prenote: No
5 SHIRLEY HEPBURN
6 Orig CR: Emilio N. Francisco (emilioef)
7 Created: 1/7/2008 6:44:00 AM Scheduled: No
8 Eff Date: 01/08/2008 Conf#: 1G5861B App: CLKCCM
9 Recipient: DOUGLAS ANDERSON (4043211) Send Prenote: Yes
10 DOUGLAS ANDERSON
11 Orig BR: Emilio N. Francisco (emilioef)
12 Created: 1/5/2008 6:52:00 AM Scheduled: Yes
13 Eff Date: 01/08/2008 Conf#: 1G5862L App: CLKCCM
14 Recipient: JOHN ZALESKY (100274) Send Prenote: No
15 JOHN ZALESKY

Any help would be appreciated.

Chuong Nguyen


--

Dave Peterson


Dave Peterson

Marco that Delete Cells With Specific Text
 
It's always nice to have options!
<bg

"Rick Rothstein (MVP - VB)" wrote:

Sigh! What was I thinking! Here I gave this longish, convoluted mechanical procedure instead of the simple, direct procedure you posted. Sometimes I have to wonder about myself. My only hope is that the OP was after the macro solution and didn't notice.<g Anyway, thanks for following up this thread with your posting.

Rick

"Dave Peterson" wrote in message ...
Another way if you really meant that you wanted to clear the contents of those
cells.

Record a macro when you:
Select column A
Edit|Replace
what: *Created:*"
with: (leave blank)
replace all



Chuong Nguyen wrote:

Please help - I need a macro to clean up a worksheet

Look for in column "A" the word "Created:" then when it is located (even
with the whole string) it will delete the whole cell

Column A
1 Orig ER: Emilio N. Francisco (emilioef)
2 Created: 1/6/2008 6:45:00 AM Scheduled: Yes
3 Eff Date: 01/08/2008 Conf#: 1G5863K App: CLKCCM
4 Recipient: SHIRLEY HEPBURN (4045656) Send Prenote: No
5 SHIRLEY HEPBURN
6 Orig CR: Emilio N. Francisco (emilioef)
7 Created: 1/7/2008 6:44:00 AM Scheduled: No
8 Eff Date: 01/08/2008 Conf#: 1G5861B App: CLKCCM
9 Recipient: DOUGLAS ANDERSON (4043211) Send Prenote: Yes
10 DOUGLAS ANDERSON
11 Orig BR: Emilio N. Francisco (emilioef)
12 Created: 1/5/2008 6:52:00 AM Scheduled: Yes
13 Eff Date: 01/08/2008 Conf#: 1G5862L App: CLKCCM
14 Recipient: JOHN ZALESKY (100274) Send Prenote: No
15 JOHN ZALESKY

Any help would be appreciated.

Chuong Nguyen


--

Dave Peterson


--

Dave Peterson


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

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