• 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.

Macro to Clear Cells based on Criteria

Hi All,

Pls help to get this macro
from ("C:N") cells should be clear
if in column "B" Criteria meets "ST"
reference file enclosed

Thanks
Jawahar
 

Attachments

  • Book1.xlsx
    9.6 KB · Views: 2
Code:
Option Explicit

Sub foo()
    Dim lr As Long, i As Long
    lr = Range("A" & Rows.Count).End(xlUp).Row
    For i = 5 To lr
        If Range("B" & i) = "ST" Then Range("C" & i & ":N" & i).ClearContents
    Next i
End Sub
 
Back
Top