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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,920
Messages
6,122,262
Members
449,075
Latest member
staticfluids

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