Hi Friends,
It is taking too long to delete the Zero value cells ans its rows.
Is there any way to select all the Zero value in a particular rows and
remove(Delete) from sheet.
Regards,
Prabhu
--
--
Some important
ehalf Of NOORAIN ANSARI
Sent: Thursday, July 28, 2011 12:31 PM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ Vba Code Required for Delete Entire Row
Dear Arpit,
Please try below code to delete row equal to 0 in J Column..
Sub delete_row()
dim i,j as long
applica
Select the Column which have 0 Value and Run this Macro
Sub DeleteBySelection()
On Error GoTo err:
Application.ScreenUpdating = False
Dim rng As Range
Dim cell As Range
Set rng = Selection
For Each cell In rng
If cell.Value = 0 Then cell.En
Dear Arpit,
please try below code..it will be help to delete all row of J
column
Sub delete_row()
Dim i, j As Long
Application.ScreenUpdating = False
j = Application.WorksheetFunction.CountA(Sheet22.Range("J:J"))
For i = j To 1 Step -1
If Sheet22.Cells(i, 10).Value = 0 Then
Sheet22.Ra
another way to delete simple just select the rows.
simple macro to understand.
*Sub deleterow()
Application.ScreenUpdating = False
Dim cell As Range
Set cell = Selection
For Each cell In Selection
If cell.Value = 0 Then
cell.EntireRow.Delete
End If
Next cell
End Sub
*
On Thu, Jul 28, 2011 at 4:59
Thaks Daniel,
your logic is super.
On Thu, Jul 28, 2011 at 4:09 PM, Daniel wrote:
> Hi,
>
> ** **
>
> Another way to do it :
>
> ** **
>
> Sub test()
>
> Dim rgRange As Range
>
> With Sheets("Report")
>
> Set rgRange = Range(.[A1], .Cells(.Rows.Count, 1).End(xlUp).Offs
Thanks Noorain for your quick respond.
It will not delete all rows properly at one time, about 50% 0 values row
penidng at the time of appling logic first time. i made some change but its
going hang. can you please modify it.
Sub delete_row()
dim i,j as long
application.screenupdating=false
Hi,
Another way to do it :
Sub test()
Dim rgRange As Range
With Sheets("Report")
Set rgRange = Range(.[A1], .Cells(.Rows.Count, 1).End(xlUp).Offset(, 9))
rgRange.AutoFilter 10, 0
Set rgRange = rgRange.Offset(1).Resize(rgRange.Rows.Count - 1)
Set rgRange = rgRange.Speci
Dear Arpit,
Please try below code to delete row equal to 0 in J Column..
Sub delete_row()
dim i,j as long
application.screenupdating=false
j=application.worksheetfunction.counta(sheet22.range("J:J"))
for i=1 to j
if sheet22.cells(i,10).value=0 then
sheet22.range("J"&i).EntireRow.Delete
end if