While consolidating multiple sheets I have to insert a column along with the header value if it doesn't exist already and save the file too.
I tried following but its not changing the column value.
I tried following but its not changing the column value.
Code:
If Workbooks(filename).Sheets("ABC").Cells("F1").Value <> "Header" Then
Columns("F:F").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Workbooks(filename).Sheets("ABC").Cells("F1").Value = "Header"
End If