Hey guys!
I have been working on a project for a while to automate a task for my work. Final steps now, but for some reason my code is not working as it should, even if I try different versions.
Sub InsertColumnsAndLabel()
' Select the "YT" sheet
Sheets("YT").Select
' Insert 4 columns after column B
Range("C1:F1").EntireColumn.Insert
' Label the columns
Range("C1").Value = "imps"
Range("D1").Value = "Spend"
Range("E1").Value = "Views"
Range("F1").Value = "Conv."
End Sub
This is one of the ones I have tried.
My issue is that even if I select or activate the sheet labeled as "YT", the next lines all end up being applied to another sheet in the workbook called "AutoBUILD".
Thanks for your help!
Pierre
I have been working on a project for a while to automate a task for my work. Final steps now, but for some reason my code is not working as it should, even if I try different versions.
Sub InsertColumnsAndLabel()
' Select the "YT" sheet
Sheets("YT").Select
' Insert 4 columns after column B
Range("C1:F1").EntireColumn.Insert
' Label the columns
Range("C1").Value = "imps"
Range("D1").Value = "Spend"
Range("E1").Value = "Views"
Range("F1").Value = "Conv."
End Sub
This is one of the ones I have tried.
My issue is that even if I select or activate the sheet labeled as "YT", the next lines all end up being applied to another sheet in the workbook called "AutoBUILD".
Thanks for your help!
Pierre