Thank you westcon1 for your assistance, you are correct it works. I have cleaned up the code. Here is what I have which is working:
VB Code:
Dim strLongDate As String Dim strResult As String Dim strSplitValues() As String Dim intCounter As Integer Calendar = vbCalHijri strLongDate = "dddd, dd' de 'MMMM' de 'yyyy" strSplitValues = Split(strLongDate, "'") For intCounter = 1 To UBound(strSplitValues) Step 2 strSplitValues(intCounter) = "'" & strSplitValues(intCounter) & "'" Next strResult = "" For intCounter = 0 To UBound(strSplitValues) If InStr(1, strSplitValues(intCounter), "'") = 0 Then strResult = strResult & Format$(Date, strSplitValues(intCounter)) Else strResult = strResult & Replace$(strSplitValues(intCounter), "'", "") End If Next intCounter MsgBox strResult




Reply With Quote