I need to insert 2 columns if the header contains "*FFT Target". I've found this code, however, it does not move on to the next column containing "FFT Target" but inserts the two rows before the first column where the heading matched.
Sheet headers I currently have are:
[TABLE="width: 500"]
<tbody>[TR]
[TD]English FFT Target[/TD]
[TD]English Teacher Assessment[/TD]
[TD]English EFG[/TD]
[TD]Maths FFT Target[/TD]
[TD]Maths Teacher Assessment[/TD]
[TD]Maths EFG[/TD]
[TD]Science FFT Target[/TD]
[TD]Science Teacher Assessment[/TD]
[TD]Science EFG[/TD]
[TD]Art FFT Target[/TD]
[TD]Art Teacher Assessment[/TD]
[TD]Art EFG[/TD]
[/TR]
</tbody>[/TABLE]
What I need is:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]English FFT Target[/TD]
[TD]English Teacher Assessment[/TD]
[TD]English EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD]Maths FFT Target[/TD]
[TD]Maths Teacher Assessment[/TD]
[TD]Maths EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD]Science FFT Target[/TD]
[TD]Science Teacher Assessment[/TD]
[TD]Science EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD]Art FFT Target[/TD]
[TD]Art Teacher Assessment[/TD]
[TD]Art EFG[/TD]
[/TR]
</tbody>[/TABLE]
The code I have is:
I'm assuming instead of next i it should be next A or something?
Any help would be greatly appreciated.
Thanks
Sheet headers I currently have are:
[TABLE="width: 500"]
<tbody>[TR]
[TD]English FFT Target[/TD]
[TD]English Teacher Assessment[/TD]
[TD]English EFG[/TD]
[TD]Maths FFT Target[/TD]
[TD]Maths Teacher Assessment[/TD]
[TD]Maths EFG[/TD]
[TD]Science FFT Target[/TD]
[TD]Science Teacher Assessment[/TD]
[TD]Science EFG[/TD]
[TD]Art FFT Target[/TD]
[TD]Art Teacher Assessment[/TD]
[TD]Art EFG[/TD]
[/TR]
</tbody>[/TABLE]
What I need is:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]English FFT Target[/TD]
[TD]English Teacher Assessment[/TD]
[TD]English EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD]Maths FFT Target[/TD]
[TD]Maths Teacher Assessment[/TD]
[TD]Maths EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD]Science FFT Target[/TD]
[TD]Science Teacher Assessment[/TD]
[TD]Science EFG[/TD]
[TD][/TD]
[TD][/TD]
[TD]Art FFT Target[/TD]
[TD]Art Teacher Assessment[/TD]
[TD]Art EFG[/TD]
[/TR]
</tbody>[/TABLE]
The code I have is:
Code:
Sub inscols()
Dim A As Range
Dim lc As Long
Dim i As Long
Set A = Rows(1).Find(what:="*Target", LookIn:=xlValues, lookat:=xlPart)
lc = Cells(1, Columns.Count).End(xlToLeft).Column
For i = 2 To lc
If A Is Nothing Then Exit Sub
A.Resize(, 2).EntireColumn.Insert
Next i
End Sub
I'm assuming instead of next i it should be next A or something?
Any help would be greatly appreciated.
Thanks