Manish Anchan
New Member
- Joined
- Jun 28, 2018
- Messages
- 1
hi
i have made a macro code to accept an array from an excel cell.
but right now i am not able to accept a value.
for ex "Series 1, Episode 4 Including the 1980s story of a campaign for a hospice to be built in the Highlands."
from the above example i need to accept series 1 in an array.
and i also want to delete series 1 from the string in the cell from the above example.
my code goes like this
Dim textstring As String, warray() As String
Dim i As Integer
For j = 2 To Range("I6553").End(xlUp).Row
textstring = Range("I" & j + 1).Value
warray = Split(expression:=textstring, delimiter:=" ", limit:=2)
Dim LResult As Integer
LResult = StrComp(warray(0), "Series")
If LResult = "0" Then
warray(0) = Range("I" & j + 1).Value
warray(0) = Range("I" & j + 1)
warray(0) = ""
ElseIf LResult = "-1" Then
LRegionName = "South"
Else
LRegionName = "West"
End If
Next j
End Sub
i have made a macro code to accept an array from an excel cell.
but right now i am not able to accept a value.
for ex "Series 1, Episode 4 Including the 1980s story of a campaign for a hospice to be built in the Highlands."
from the above example i need to accept series 1 in an array.
and i also want to delete series 1 from the string in the cell from the above example.
my code goes like this
Dim textstring As String, warray() As String
Dim i As Integer
For j = 2 To Range("I6553").End(xlUp).Row
textstring = Range("I" & j + 1).Value
warray = Split(expression:=textstring, delimiter:=" ", limit:=2)
Dim LResult As Integer
LResult = StrComp(warray(0), "Series")
If LResult = "0" Then
warray(0) = Range("I" & j + 1).Value
warray(0) = Range("I" & j + 1)
warray(0) = ""
ElseIf LResult = "-1" Then
LRegionName = "South"
Else
LRegionName = "West"
End If
Next j
End Sub