matratus34
Board Regular
- Joined
- Nov 21, 2013
- Messages
- 76
Hi,
Would anyone be able to tell me why this code doesn’t loopto the next worksheet and only performs the task on the activesheet?
I realise my code is poor but this is just a tester for afew additional tasks to be performed within the loop – but at this stage I can’teven get the loop to work!
As always thanks for all the support!
Thanks
Matt
Would anyone be able to tell me why this code doesn’t loopto the next worksheet and only performs the task on the activesheet?
I realise my code is poor but this is just a tester for afew additional tasks to be performed within the loop – but at this stage I can’teven get the loop to work!
As always thanks for all the support!
Code:
Sub InsertColumn()
For Each ws In ActiveWorkbook.Worksheets
Columns("A:AH").Select
Selection.EntireColumn.Hidden = False
Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A6").Select
ActiveCell.FormulaR1C1 = "Project"
Range("B3").Select
Selection.Copy
Range("A7").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("A7:A399")
Next ws
End Sub
Thanks
Matt
Last edited by a moderator: