Split funtion

hianupam

New Member
Joined
Mar 28, 2002
Messages
37
I am trying to use the split function to split a string. How do I assign the values returned by the function ?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
On 2002-09-06 13:38, hianupam wrote:
I am trying to use the split function to split a string. How do I assign the values returned by the function ?

Hi hianupam
What exactly are you trying to do...example
The above function returns an array...so you will need to get the Upperbound and lowerbound limits of the array and then assign it to some variables you have set up.
Post an example of what you have and what you require.
 
Upvote 0
Guys thanks for the replies. Frustated with it i wrote my own split function.
Here is what I was trying to do
I have a string say SERC-TVA
I wanted SERC and TVA separated at the delimeter "-"
 
Upvote 0
On 2002-09-06 13:48, Mark W. wrote:
Haven't heard of the SPLIT function. Do you mean the MID function?
Mark there is a function called split in VB.Look it up in the VBA help (not much help though ...no examples)
 
Upvote 0
Here is an example using your string

<pre/>
Sub TesterII()
Dim Ret
Dim i As Integer

Const strS As String = "SERC-TVA"

Ret = Split(strS, "-")

For i = 0 To UBound(Ret)
MsgBox Ret(i)
Next

End Sub
</pre>
 
Upvote 0
On 2002-09-06 14:25, hianupam wrote:
On 2002-09-06 13:48, Mark W. wrote:
Haven't heard of the SPLIT function. Do you mean the MID function?
Mark there is a function called split in VB.Look it up in the VBA help (not much help though ...no examples)

Ahh! I thought you were asking an Excel question.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,195
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top