Arunachaljois
Board Regular
- Joined
- Aug 1, 2020
- Messages
- 57
- Office Version
- 365
- Platform
- Windows
Got error while adding column and filter
In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is "Error" by filtering Z column and select only "Error" otherwise i don't want to add column
Could please help me out this
If cell.Range("Z2:Z" & LR) = "Error" Then
Columns("AA:AA").Select
Selection.Insert Shift:=xlToRight
Range("AA1").Value = "Comments"
End If
With Sheets("PIR Template")
.AutoFilterMode = False
With .Range("A1:AG1")
.AutoFilter
.AutoFilter Field:=26, Criteria1:="Error"
End With
End With
In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is "Error" by filtering Z column and select only "Error" otherwise i don't want to add column
Could please help me out this
If cell.Range("Z2:Z" & LR) = "Error" Then
Columns("AA:AA").Select
Selection.Insert Shift:=xlToRight
Range("AA1").Value = "Comments"
End If
With Sheets("PIR Template")
.AutoFilterMode = False
With .Range("A1:AG1")
.AutoFilter
.AutoFilter Field:=26, Criteria1:="Error"
End With
End With