ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Delete Row Macro - if cell $5000 (https://www.excelbanter.com/excel-worksheet-functions/52246-delete-row-macro-if-cell-%245000.html)

Danny

Delete Row Macro - if cell $5000
 
Hi,

How do I delete a rows in Column F if a cell reflects a value of more than
$5,000.

Thanks

Chip Pearson

Delete Row Macro - if cell $5000
 
You can do it with a VBA macro:

Sub AAA()
Dim LastRow As Long
Dim RowNdx As Long
LastRow = Cells(Rows.Count, "F").End(xlUp).Row
For RowNdx = LastRow To 1 Step -1
If Cells(RowNdx, "F").Value 5000 Then
Rows(RowNdx).Delete
End If
Next RowNdx
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Danny" wrote in message
...
Hi,

How do I delete a rows in Column F if a cell reflects a value
of more than
$5,000.

Thanks





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

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