Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
LaurenceL
 
Posts: n/a
Default Delete a whole row using a macro

I am trying to set a macro up in Excel so that it will check a value in
column A and if the value equals 'abc' (or whatever other value), I want to
delete the row all together.
I haven't used VB in a long time, and I don't know how to get started... Any
help will be greatly appreciated.

Thank you
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default


cLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = cLastRow to 1 Step -1
If Cells(i,"A").Value =, "abc" Then
Cells(i,"A").EntireRow.Delete
End If
Next i

--

HTH

RP
(remove nothere from the email address if mailing direct)


"LaurenceL" wrote in message
...
I am trying to set a macro up in Excel so that it will check a value in
column A and if the value equals 'abc' (or whatever other value), I want

to
delete the row all together.
I haven't used VB in a long time, and I don't know how to get started...

Any
help will be greatly appreciated.

Thank you



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
Cannot delete a macro Jeff B Excel Discussion (Misc queries) 3 February 15th 05 12:43 AM
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? oil_driller Excel Discussion (Misc queries) 1 February 8th 05 09:34 AM
delete row contains specific word in an macro Jean-Francois Excel Discussion (Misc queries) 4 January 11th 05 11:40 PM
How to delete a macro that has been assigned to run when workshee. tcsigecan Excel Worksheet Functions 1 December 28th 04 10:11 PM
Macro to delete a macro Spanky Excel Worksheet Functions 1 December 16th 04 02:43 AM


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

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

About Us

"It's about Microsoft Excel"