Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, Excel97 doesn't have the Split function. Try this
Option Explicit Sub Choose() Dim sValues As String Dim myString As String Dim StringValues Dim i As Long sValues = _ "A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12" StringValues = Split(sValues, ",") For i = 0 To UBound(StringValues) If Cells(i + 1, "A").Value < StringValues(i) Then Cells(i + 1, "A").EntireRow.Insert End If Next i End Sub #If VBA6 Then #Else '----------------------------------------------------------------- Function Split(Text As String, _ Optional Delimiter As String = ",") As Variant '----------------------------------------------------------------- Dim i As Long Dim sFormula As String Dim aryEval Dim aryValues If Delimiter = vbNullChar Then Delimiter = Chr(7) Text = Replace(Text, vbNullChar, Delimiter) End If sFormula = "{""" & Application.Substitute(Text, Delimiter, """,""") & """}" aryEval = Evaluate(sFormula) ReDim aryValues(0 To UBound(aryEval) - 1) For i = 0 To UBound(aryValues) aryValues(i) = aryEval(i + 1) Next Split = aryValues End Function #End If -- HTH RP (remove nothere from the email address if mailing direct) "DaSo" wrote in message ... Hi Bob, yes I have Excel 97, so I guess thatīs the problem? Dan *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
find and replace numeric strings in larger text strings | Excel Worksheet Functions | |||
Working with Strings | Excel Discussion (Misc queries) | |||
How to find number of pairs of strings from list of strings? | Excel Worksheet Functions | |||
Working with strings | Excel Programming | |||
Working with strings | Excel Programming |