Hello,
I'm having troubles figuring this out.
I have an external Array in a notepad, where there are a Bunch of strings.
I Want to make a new Array from a line from this Array.
Say "Arr(0)" contains the following:1 2 3 4 5 6 7 8
From there I want a new array (lets call it nArr) that can return Arr(1) = 2 (Arr(3) = 4) all the way to the end.
I've tried using a split function, but can't figure out how to make Lbound(SV) To Ubound(SV) a new array.
Do I even need to make a new array, or can I use the first Array only?
(I use the external array to store several values split by spaces, and depending on which action in the script I need to perform, I need to return a certain "row" from that array and use that as the "key" for what values I want the script to find in a Range. Ive gotten the deletion part to work perfectly, but I cant figure out how to make the array itself)
Does Anyone have any ideas?
I'm having troubles figuring this out.
I have an external Array in a notepad, where there are a Bunch of strings.
I Want to make a new Array from a line from this Array.
Say "Arr(0)" contains the following:1 2 3 4 5 6 7 8
From there I want a new array (lets call it nArr) that can return Arr(1) = 2 (Arr(3) = 4) all the way to the end.
I've tried using a split function, but can't figure out how to make Lbound(SV) To Ubound(SV) a new array.
VBA Code:
FileName = "C:\location\notepad.txt"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set MyFile = FSO.OpenTextFile(FileName, 1)
Arr = Split(MyFile.ReadAll, vbNewLine)
Dim SV() As String
SV = Split(Arr(0), " ")
Do I even need to make a new array, or can I use the first Array only?
(I use the external array to store several values split by spaces, and depending on which action in the script I need to perform, I need to return a certain "row" from that array and use that as the "key" for what values I want the script to find in a Range. Ive gotten the deletion part to work perfectly, but I cant figure out how to make the array itself)
Does Anyone have any ideas?