computing
  • 0

Solved Set column focus in VBA

  • 0

I am using VBA in Excel.
How do I get my code to run only for Column E. Right now it is running for the entire worksheet. How do I set the focus for Column E.

This should work.

Sub ChgStatus()

    Sheets(1).Columns("E").Replace What:="Pending", Replacement:="Done", _
        LookAt:=xlPart, MatchCase:=False
End Sub

Click Here Before Posting Data or VBA Code —> How To Post Data or Code.

Share

1 Answer

  1. This should work.

    Sub ChgStatus()
    
        Sheets(1).Columns("E").Replace What:="Pending", Replacement:="Done", _
            LookAt:=xlPart, MatchCase:=False
    End Sub
    

    Click Here Before Posting Data or VBA Code —> How To Post Data or Code.

    • 0