Sorry for not been enough clear in my previous message!
Here is the situation A user have the possibility to add new row in an Excel Array. I would like then to stock the new parameter in the last line of a dynamic array on macro in order to make other calculations.
For example: I have an Array of 2 columns: Parameter and Value Parameter <-- B1 column Param1 Param2 Param3
Value <-- C1 column Val1 Val2 Val3
Hereafter what I have done but it doesn't work!
Dim RowCount As Integer
RowNumber = Sheets("Feuil1").Range("C1").End(xlDown).row
'MsgBox "Rows:" & RowNumber-1
Dim tb_val() As Integer
ReDim tb_val(RowNumber - 1)
Dim lc() As Integer
For i = 1 To RowNumber
lc = PathFinder("Feuil1", Cells(i, 2).Value)
tb_val(i - 1) = Sheets("Feuil1").Cells(lc(1), lc(2) + 1).Value
Next i
P.S: PathFinder("worksheet1", "word1") send arr(2) with cells details -column & row- of "word1" found in "worksheet1"
Function PathFinder(sheet1 As String, word1 As String) As Integer()
Dim rng As Range
Dim rngFound As Range
Dim temp(2) As Integer
Set rng = Sheets(sheet1).Range("A:B")
Set rngFound = rng.Find(word1, LookAt:=xlWhole, SearchOrder:=xlByRows)
If rngFound Is Nothing Then
MsgBox "not found"
Else:
temp(1) = rngFound.row
temp(2) = rngFound.column
End If
PathFinder = temp
End Function
Thanks