(Solved) – ActiveCell.Offset not working while filter is active

(solved)-–-activecell.offset-not-working-while-filter-is-active

Code:-

Sub Macro6()
'
' Macro6 Macro
'
' Keyboard Shortcut: Ctrl Shift A
'
    Columns("B:B").Select
    Selection.Insert Shift:=xlToRight
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "p"
    Range("C1").Select
    Selection.AutoFilter
    ActiveSheet.Range("A1", Range("C" & Rows.Count).End(xlUp)).AutoFilter Field:=3, Criteria1:="Credit"
    ActiveCell.Offset(1, -1).Select
    'ActiveCell.Offset(1, 0).Select
    'Selection.AutoFilter
End Sub

It is giving the below result:-

enter image description here

But it should be “B5” in this case.

Leave a Reply

Your email address will not be published. Required fields are marked *