Consulting

Results 1 to 4 of 4

Thread: Column "A", where the zero value where the column "B" must be delete in the Value

  1. #1

    Column "A", where the zero value where the column "B" must be delete in the Value

    Column "A", where the zero value where the column "B" must be cleared in the Value
    Attached Files Attached Files

  2. #2
    VBAX Mentor
    Joined
    Feb 2015
    Posts
    395
    Location
    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

  3. #3
    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

  4. #4
    Thank for Replay it great work.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •