I need to populate the S column. S1 = header string and S2-end = value from the formula. I need to filldown.
I'm doing several test based on the following cone below (I'm think I'm pretty close to the solution).
Sub NewTest()
Dim sh As Worksheet
Dim rng As Range
Set sh = Sheets("Existing 2W")
Set rng = Range("S2:S" & Range("S" & Rows.Count).End(xlUp).Row)
Sheets("Existing 2W").Range("S1").Interior.ColorIndex = 3 ' 3 indicates Red Color
''''The following two lines are working fine to fill the S2 cell but now I want to fill S2:S
'Sheets("Existing 2W").Range("S2").Value = WorksheetFunction.Index(Range("Latest_Range"), WorksheetFunction.Match(Left(Right((Sheets("Existing 2W").Range("Z2").Value), 11), 5), Range("LatestLineNo"), 0), 11)
'Sheets("Existing 2W").Range("S2").Value = Application.Index(Range("Latest_Range"), Application.Match(Left(Right((Sheets("Existing 2W").Range("Z2").Value), 11), 5), Range("LatestLineNo"), 0), 11)
With sh
With .Range("S2")
.FormulaLocal = "=INDEX(Latest_Range;EQUIV(GAUCHE(DROITE(Z2;11);5);LatestLineNo;0);11)"
.FormulaArray = .Formula
.AutoFill rng
End With
End With
End Sub