RE: replace value in array Gary Roberts 4.May.12 04:48 PM a Web browser Applications Development 7.0.3 FP1Windows XP
Use the ArrayGetIndex function to get the index for the value you want to replace, then simply replace it...
Here is a LONG example to show you... Bottom line is ArrayGetIndex will return the Array Index where it found the value you are looking for, or it will return a Null. Very simple...
Const CaseInsensitivePitchInsensitive = 5
Dim varArrayIndex As Variant
Dim strSearchValue As String
If Isnull( varArrayIndex ) Then
Msgbox strSearchValue & " is not in the array..."
Else
Msgbox "Found " & strSearchValue & " at index " & varArrayIndex
REM Replacing the value in the array...
arrayWhatever( varArrayIndex ) = strNewValue
Msgbox "Replaced value for element " & varArrayIndex & " with " & arrayWhatever( varArrayIndex )
End If