I have an auto filter on my excel file activated in my macro. When I run my code, I got the following error message:
Run time error 438, Object does not support this property or method
I tried to run my macro step by step via F8, it seems that this line below generated this error:
Range(ActiveCell, ActiveCell.End(xlDown)).Paste
I want that my macro execute the following action:
- All my visible filtered lines in column AA are copied in column K
- All my visible filtered lines in column J are replaced by the value “J0”
If someone could help me, it would be great.
Sub fuelstep4ArvalBIF()
Application.ScreenUpdating = False
Range("A1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$AF$3000").AutoFilter Field:=25, Criteria1:=Array( _
"21.00", "21", "19.00", "19", "5.50", "5.5", "13.00", "13"), Operator:=xlFilterValues
Call FirstVisibleCellAA
Range(ActiveCell, ActiveCell.End(xlDown)).Copy Call FirstVisibleCellK
Range(ActiveCell, ActiveCell.End(xlDown)).Paste Call FirstVisibleCellJ
ActiveCell.Value = "J0" ActiveCell.Copy Range(ActiveCell,
ActiveCell.End(xlDown)).Paste
End Sub
Sub FirstVisibleCellK()
With ActiveSheet.AutoFilter.Range
Range("K" & .Offset(1, 0).SpecialCells(xlCellTypeVisible)(1).Row).Select
End With
End Sub
Sub FirstVisibleCellAA()
With ActiveSheet.AutoFilter.Range Range( _
"AA" & .Offset(1, 0).SpecialCells(xlCellTypeVisible)(1).Row).Select
End With
End Sub
Sub FirstVisibleCellJ() With ActiveSheet.AutoFilter.Range
Range("J" & .Offset(1, 0).SpecialCells(xlCellTypeVisible)(1).Row).Select
End With End Sub
Thanks in advance for your help.