Consulting

Results 1 to 4 of 4

Thread: vba, how to code to select cell after certain filter field

  1. #1

    vba, how to code to select cell after certain filter field

    Columns("H:H").Select
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    Rows("1:1").Select
    Selection.AutoFilter
    ActiveSheet.Range("A:AT").AutoFilter Field:=4, Criteria1:=Array( _
    "POitem", "PurRqs", "ShpgNt"), Operator:=xlFilterValues
    Range("F2:F" & Range("F" & Rows.Count).End(xlUp).Row).SpecialCells(12).Value = 0
    Range("H2:H" & Range("H" & Rows.Count).End(xlUp).Row).SpecialCells(12).Formula = "=IF(F2=0, ABS(F2-G2),F2-G2)" (not working)
    Selection.Copy
    Selection.AutoFilter
    Attached Images Attached Images

  2. #2
    Can someone help please

  3. #3
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    It would help if you asked a question!
    (not working)
    doesn't work for me! What isn't working? What is the error?
    Semper in excretia sumus; solum profundum variat.

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,872
    What's the betting column H is largely empty?
    Try changing the red H below to a column letter you're sure is going to be full to the bottom of the table:
    Range("H2:H" & Range("H" & Rows.Count).End(xlUp).Row).SpecialCells(12).Formula = "=IF(F2=0, ABS(F2-G2),F2-G2)" '(working)
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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