Home Excel Powerpoint Word Outlook Error Codes

VBA Useful Codes

Welcome to the World of VBA
Home > VBAUsefulCodes

Update Values of Filtered Rows using Autofilter


Following code Filters the rows with specified criteria using autofilter. After filter It updates values for corresponding filtered values.

With ThisWorkbook.Worksheets("Output").UsedRange

        ThisWorkbook.Worksheets("Output").AutoFilterMode = False

        ThisWorkbook.Worksheets("Output").Rows("1:1").AutoFilter

    

        .AutoFilter Field:=61, Criteria1:="=", Operator:=xlFilterValues

        visible_Rows = 0

        visible_Rows = ThisWorkbook.Worksheets("Output").AutoFilter.Range.Columns(2).SpecialCells(xlCellTypeVisible).Cells.Count - 1

        If visible_Rows > 0 Then

            .Columns(61).Offset(1).Resize(.Rows.Count - 1) = "0"

        End If

        .AutoFilter

    End With


Subscribe

Enter your e-mail below and get notified on the latest blog posts.




Tags

VBA Outlook KPI Excel Alt+F11 Dashboards Macros Recording Graphs Automation Developer WaterFall Powerpoint Charts Pivot Tables Forecast Charts


Follow Us