ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Specific Cell Selecting (https://www.excelbanter.com/excel-programming/364156-specific-cell-selecting.html)

bodhisatvaofboogie

Specific Cell Selecting
 
Now I want to select every cell in a column with the word "Critical" in it
and have the contents deleted. So: Select every cell in column H with the
word "Critical" in it then have it deleted. What would that look like in a
formula for a macro??? THANKS!!!!

Bob Phillips

Specific Cell Selecting
 
Rows(1).Insert
Columns("H:H").AutoFilter field:=1, Criteria1:="Critical"
Columns("H:H").SpecialCells(xlCellTypeVisible).Ent ireRow.Delete


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"bodhisatvaofboogie" wrote in
message ...
Now I want to select every cell in a column with the word "Critical" in it
and have the contents deleted. So: Select every cell in column H with

the
word "Critical" in it then have it deleted. What would that look like in

a
formula for a macro??? THANKS!!!!




Tom Ogilvy

Specific Cell Selecting
 
Sub DeleteCriticalRows()
Dim rng as Range
set rng = columns("H").find("critical", Range("H1"))
if not rng is nothing then
do
rng.Entirerow.Delete
set rng = columns("H").find("critical",Range("H1"))
loop while not rng is nothing
End if
End sub

--
Regards,
Tom Ogilvy

"bodhisatvaofboogie" wrote:

Now I want to select every cell in a column with the word "Critical" in it
and have the contents deleted. So: Select every cell in column H with the
word "Critical" in it then have it deleted. What would that look like in a
formula for a macro??? THANKS!!!!



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

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