ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   deleting cells: Auto filter or loop or what (https://www.excelbanter.com/excel-programming/404259-deleting-cells-auto-filter-loop-what.html)

Andyjim

deleting cells: Auto filter or loop or what
 
I have tried to accomplish deleting certain cells based on the criteria in
Column 46 labeled as TRUE. I have tried a loop and an auto filter but I am
not getting either to work. I also tried recording a macro using the auto
filter and still no luck (the code was slightly different than the code
below). I need to get this solved as soon as possible. You folks always
come through for us...sorry to be so impatient. Included is the code for
the auto filter and the code I tried for the loop:

auto filter:
Range("AR16:AR56").AutoFilter Field:=46, Criteria1:="TRUE"
Range("A17:F56" & Rows.Count).SpecialCells(xlCellTypeVisible).Value = ""
Range("K17:M56" & Rows.Count).SpecialCells(xlCellTypeVisible).Value = ""
Range("O17:S56" & Rows.Count).SpecialCells(xlCellTypeVisible).Value = ""
Range("AR16:AR56").AutoFilter


Loop:

Dim clearrow

'Loop: Check for complete trades, delete

For X = 1 To TradesEntered.Count
Set ClosCheck = TradesEntered(X)


If ClosCheck.Value = "True" Then
With ClosCheck

clearrow = ActiveCell.Row
Range("A17" & clearrow & ":F56" & clearrow).Value = ""
Range("K17" & clearrow & ":M56" & clearrow).Value = ""
Range("O17" & clearrow & ":S56" & clearrow).Value = ""
End With

End If
Next


All times are GMT +1. The time now is 11:46 AM.

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