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:
English FFT Target English Teacher Assessment English EFG Maths FFT Target Maths Teacher Assessment Maths EFG
What I need is
[blank column] [blank column] English FFT Target English Teacher Assessment English EFG [blank column] [blank column] Maths FFT Target Maths Teacher Assessment Maths EFG
The code I have is:
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
Unfortunately, this code inserts all the columns before English FFT Target rather than moving on and inserting columns before the next column containing FFT Target.
Any help would be greatly appreciated.
Thanks
Areturns a single range and is never updated. Also, please post a screenshot as your layout is not clear from your question.