PDA

View Full Version : [SOLVED:] Column "A", where the zero value where the column "B" must be delete in the Value



sanju2323
02-27-2015, 05:20 AM
Column "A", where the zero value where the column "B" must be cleared in the Value

Yongle
02-27-2015, 08:24 AM
Try this

Sub ColumnC_value()
Dim LastRow As Long
Sheets("sheet1").Range("A1").End(xlDown).Select
LastRow = ActiveCell.Row
For r = 2 To LastRow
ref = Cells(r, 1).Value
Value = Cells(r, 2).Value
If ref <> 0 Then
Cells(r, 3).Value = Cells(r, 2).Value
Else
End If
Next r
End Sub

jolivanes
02-27-2015, 11:11 AM
Or you could try this on a copy of your workbook to see if it fits your needs.
On a large range it should be slightly faster.

Sub With_AutoFilter()
Application.ScreenUpdating = False
With Sheets("Sheet1").Range("A2:C" & Cells(Rows.Count, 1).End(xlUp).Row)
.AutoFilter 1, "0.000"
End With
Range("B3:B" & Cells(Rows.Count, 2).End(xlUp).Row).SpecialCells(12).ClearContents
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub

sanju2323
02-27-2015, 08:02 PM
Thank for Replay it great work.