• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

code entire row based on cells value

alhagag

Member
hi guys
i need the code delete entire row based on cells value in column c if the value in c =0 then delete the entire row
 

Attachments

  • delete entire row.xlsm
    18.5 KB · Views: 5
Code:
Option Explicit

Sub DelC()
    Dim i As Long, lr As Long
    lr = Range("A" & Rows.Count).End(xlUp).Row
    For i = lr To 1 Step -1
        If Range("C" & i) = 0 Then
            Range("C" & i).EntireRow.Delete
        End If
    Next i
End Sub
 
What event would you envision triggering the execution of the code and why? Please explain your business scenario.
 
i imagine having 5 items of expenses sometimes full all of data the items and in cases just two or three items of expenses ok let me explain more
i have sheet1 contains a,b,c,(item,describe, value) and contain theses columns 5 item of expenses when i fill just 3 items of expenses the data then the 4,5 items of expenses when the value of column (c)=0 should delete the rows which for item 4,5 directly when press enter after row3
if this is not clear i try attaching file
 
Your explanation is very confusing for me. Suggest you upload a file that is representative of your actual file and explain your logic in specific business terms using your sheet as an example. What appears to be crystal clear to you is very fuzzy to me.
 
Back
Top