Hi Guys,
I try subtracting values between two columns E,F and insert column H for all of the sheets , after that will delete column E,F after subtraction . it shows error mismatch in this line
With Sheets(sh).Cells(1).CurrentRegion
Sub test1()
Dim sh As Worksheet
For Each sh In Worksheets
With Sheets(sh).Cells(1).CurrentRegion
X = Application.Match("net", .Rows(1), 0)
If IsError(X) Then
.Columns(.Columns.Count).Copy .Columns(.Columns.Count + 1)
With .Columns(.Columns.Count + 1)
.Cells(1) = "NET"
With .Offset(1).Resize(.Rows.Count - 1)
.FormulaR1C1 = "=rc[-2]-rc[-1]"
.Value = .Value
End With
End With
End If
End With
Next
With Sheets(sh).Cells(1).CurrentRegion
.Columns("E:F").Delete
End With
Next
End Sub