Sub-string Function in VBA

Report
Posts
31
Registration date
Wednesday August 26, 2020
Status
Member
Last seen
August 5, 2021
-
Dear Experts,

I want to get the length of char and split the char with 30000. Below is the code. I'm stuck here to do further. Can you please help me with that. I have added my comments in below code

Public Sub Test(Test Reference, ByRef oTable3 As ListObject)

Dim Test1 As IXMLDOMNode

Dim Activerow As Long
Dim oListRow As ListRow
Dim oListRow1 As ListRow
Dim CurrentRows As Long
'Dim action As String

Dim FileContentURI As IXMLDOMElement
Dim LResult As String 'Length
Dim strFull As String 'Fullstring


CurrentRows = GnRow1s

Set oListRow = oTable3.ListRows(CurrentRows)

For Each Test1 In Test Reference

Set FileContentURI = Test1.SelectSingleNode("NumChar")  ' I have retrived the more then 6lakhs char from the "NumChar"
LResult = Len(FileContentURI.nodeTypedValue)                     ' I would like to count the length of char (NumChar)
strFull = LResult                                                          

 ' here I want to split the NumChar from 1 to 30000

oListRow.Range.Cells(1, 3) = FileContentURI.Text 

' The split char assign the cell (1,3) then split next 30000 char and assign the Cell (1,4) up to 6 lakhs. But 6lakhs is not fixed char It will be an increase or decrease based on "NumChar" need to assign the value in cells.Finally, all the splited value to concat in one variable.


CurrentRows = CurrentRows + 1


Next

WSCalls = True

End Sub