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

vba code required to delete zero (0) in range

rahulshewale1

Active Member
Dear sir,

Please fidn the attached sheet. i want to delete zero column a,column b,column c.


if i select any column zero will delete with vba button


Thanks
Rahul shewale
 

Attachments

Please explain a little more clearly. If you select column A, then do you wish to delete the whole column or just the row containing the zero value or something else. How do you wish to select the column? Input Box? Unfortunately, we are not mind readers here and you really need to explain in detail what you wish to accomplish.
 
Attach this code to a button
Code:
Option Explicit

Sub del0()
    Dim lr As Long
    lr = Range("A" & Rows.Count).End(xlUp).Row
    Dim col As String
    col = InputBox("Which column do you wish to review?")
    Dim i As Long
    For i = 1 To lr
        If Cells(i, col) = 0 Then Cells(i, col).ClearContents
    Next i
End Sub
 
Back
Top