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

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Mark W.

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,654
Haven't heard of the SPLIT function. Do you mean the MID function?
 

Ivan F Moala

MrExcel MVP
Joined
Feb 10, 2002
Messages
4,209
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.
 

hianupam

New Member
Joined
Mar 28, 2002
Messages
37
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 "-"
 

hianupam

New Member
Joined
Mar 28, 2002
Messages
37

ADVERTISEMENT

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)
 

Ivan F Moala

MrExcel MVP
Joined
Feb 10, 2002
Messages
4,209
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>
 

Mark W.

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,654
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,444
Messages
5,642,172
Members
417,259
Latest member
gtacw

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
Top