Richard Schollar
MrExcel MVP
- Joined
- Apr 19, 2005
- Messages
- 23,707
Surely, you would use conditional compilation?
Care to enlighten me, Mr P? I could probably stretch to another metaphorical gin in return
Surely, you would use conditional compilation?
Wouldn't that be
=A1-DAY(A1)+1
Barry?
Surely, you would use conditional compilation?
Care to enlighten me, Mr P? I could probably stretch to another metaphorical gin in return
#If TestRun Then
‘some normal code that is executed if a test run
#Else
‘some other normal code that is executed when it is NOT a test run
#End If
#CONST TestRun = True
#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
Hi, xld,So now you know why I wondered why he didn't use conditional compilation.
Chilled glass, chilled alcohol, but don't water it (I only water my scotch!).