This is one of my first macros so all help is appreciated. This part of the macro searches for a column header then cuts it and places it in a different column location. I wrote it to paste the column and it works fine but I need it to now insert the column instead of pasting it and I can't seem to get the code right. This is what I have been using:
For Each rng In Range("A5:IV5")
If rng.Value = "Src Type" Then
rng.EntireColumn.Cut
Sheets("OBLog_Formatted").Select
Columns("D:D").Select
ActiveSheet.Paste
End If
If rng.Value = "Date" Then
rng.EntireColumn.Cut
Sheets("OBLog_Formatted").Select
Columns("E:E").Select
ActiveSheet.Paste
End If
If rng.Value = "Line Name" Then
rng.EntireColumn.Cut
Sheets("OBLog_Formatted").Select
Columns("F:F").Select
ActiveSheet.Paste
End If
Next rng
Is there an easy way to convert this to insert instead?
Thanks
For Each rng In Range("A5:IV5")
If rng.Value = "Src Type" Then
rng.EntireColumn.Cut
Sheets("OBLog_Formatted").Select
Columns("D:D").Select
ActiveSheet.Paste
End If
If rng.Value = "Date" Then
rng.EntireColumn.Cut
Sheets("OBLog_Formatted").Select
Columns("E:E").Select
ActiveSheet.Paste
End If
If rng.Value = "Line Name" Then
rng.EntireColumn.Cut
Sheets("OBLog_Formatted").Select
Columns("F:F").Select
ActiveSheet.Paste
End If
Next rng
Is there an easy way to convert this to insert instead?
Thanks