beartooth91
New Member
- Joined
- Dec 15, 2024
- Messages
- 44
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Probably an obvious mistake, but can't find the problem. The code below works....does what its supposed to do....splits and fills in all the values, but, at the end of the loop, I'm getting the "subscript out of range" error.
VBA Code:
Sub Fill_Sig_Type3()
'Using split string
Dim LastRow As Long, i As Long, StringArray() As String
With ActiveSheet
LastRow = .Cells(Rows.Count, "B").End(xlUp).Row + 1
For i = 8 To LastRow
StringArray = Split(.Cells(i, "B"), "-", -1)
.Cells(i, "E").Value = StringArray(1) '<----Getting 'subscript out of range' error at end of loop
Next i
End With
End Sub