Howdy inarbeth. A few thoughts, you can still work with the numbers that the vba cranks out with a straight-forward formula like below:
This formula is based of user defined function I wrote, you can use it by placing it in a standard/normal Excel module, the code is as follows:<pre>
Private Function nbrs(n As String)
Dim y As Integer
Application.Volatile
If InStr(n, "s") Then
y = InStr(n, "s")
nbrs = Mid(n, 1, y - 1) + 0
End If
If InStr(n, "n") Then
y = InStr(n, "n")
nbrs = Mid(n, 1, y - 1) + 0
End If
If InStr(n, "r") Then
y = InStr(n, "r")
nbrs = Mid(n, 1, y - 1) + 0
End If
If InStr(n, "h") Then
y = InStr(n, "h")
nbrs = Mid(n, 1, y - 2) + 0
End If
End Function</pre>
The other thing that I can think of is to use a procedure like below which will add the text to the adjacent column (have a blank column), this way you can store the entry as a date and format it to look like a day number. From here you can concatenate, etc...<pre>
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If IsDate(Target) And Not Target.HasFormula Then
If Right(Format(Target, "d"), 1) = 1 And _
Format(Target, "d")<> 11 Then
Target.NumberFormat = "d"
Target(, 2).Value = "st"
ElseIf Right(Format(Target, "d"), 1) = 2 And _
Format(Target, "d")<> 12 Then
Target.NumberFormat = "d"
Target(, 2).Value = "nd"
ElseIf Right(Format(Target, "d"), 1) = 3 And _
Format(Target, "d")<> 13 Then
Target.NumberFormat = "d"
Target(, 2).Value = "rd"
Else: Target.NumberFormat = "d"
Target(, 2).Value = "th"
End If
End If
Application.EnableEvents = True
End Sub</pre>
Here's a look at some things I did with it (you can now use networkdays, etc....)
Questions or concerns, please post back.
_________________
Cheers,<font size=+2><font color="red">
Nate<font color="blue"> Oliver</font></font></font>
This message was edited by NateO on 2002-06-23 13:34