Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Date Conversion

Hello,

Do any have a finction which will enable to convert date from Gregorian
to Hijri and Vise Versa?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Date Conversion

Abdul,
Something like this. I don't know what kind of formatting you would use for
the Hijri dates, but you get the idea.

Private Sub CommandButton1_Click()
Dim Cal As Long
Dim DateConv As Date

Cal = Calendar
DateConv = Now()

Calendar = vbCalGreg
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = vbCalHijri
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = Cal

End Sub

NickHK

"Abdul" wrote in message
ps.com...
Hello,

Do any have a finction which will enable to convert date from Gregorian
to Hijri and Vise Versa?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Date Conversion

Thanks Nick,

How I can convert his to a function, so that i can use that as a
formula in sheet?

thanks again


NickHK wrote:
Abdul,
Something like this. I don't know what kind of formatting you would use for
the Hijri dates, but you get the idea.

Private Sub CommandButton1_Click()
Dim Cal As Long
Dim DateConv As Date

Cal = Calendar
DateConv = Now()

Calendar = vbCalGreg
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = vbCalHijri
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = Cal

End Sub

NickHK

"Abdul" wrote in message
ps.com...
Hello,

Do any have a finction which will enable to convert date from Gregorian
to Hijri and Vise Versa?

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Date Conversion

Abdul,
I never had a reason to use this, so I not sure.
But check out Excel's help on "Calendar" and see how to specify the date
format on a worksheet.
You need a version that support this.

NickHK

"Abdul" wrote in message
oups.com...
Thanks Nick,

How I can convert his to a function, so that i can use that as a
formula in sheet?

thanks again


NickHK wrote:
Abdul,
Something like this. I don't know what kind of formatting you would use

for
the Hijri dates, but you get the idea.

Private Sub CommandButton1_Click()
Dim Cal As Long
Dim DateConv As Date

Cal = Calendar
DateConv = Now()

Calendar = vbCalGreg
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = vbCalHijri
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = Cal

End Sub

NickHK

"Abdul" wrote in message
ps.com...
Hello,

Do any have a finction which will enable to convert date from

Gregorian
to Hijri and Vise Versa?

Thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Date Conversion

Thanks Nick,

How I can convert this to a function, so that i can use that as a
formula in sheet?

thanks again


NickHK wrote:
Abdul,
Something like this. I don't know what kind of formatting you would use for
the Hijri dates, but you get the idea.

Private Sub CommandButton1_Click()
Dim Cal As Long
Dim DateConv As Date

Cal = Calendar
DateConv = Now()

Calendar = vbCalGreg
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = vbCalHijri
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = Cal

End Sub

NickHK

"Abdul" wrote in message
ps.com...
Hello,

Do any have a finction which will enable to convert date from Gregorian
to Hijri and Vise Versa?

Thanks




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Date Conversion

Thanks Nick,

How I can convert this to a function, so that i can use that as a
formula in sheet?

thanks again


NickHK wrote:
Abdul,
Something like this. I don't know what kind of formatting you would use for
the Hijri dates, but you get the idea.

Private Sub CommandButton1_Click()
Dim Cal As Long
Dim DateConv As Date

Cal = Calendar
DateConv = Now()

Calendar = vbCalGreg
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = vbCalHijri
Debug.Print Format(DateConv, "dd dddd/mmmm/yyyy")

Calendar = Cal

End Sub

NickHK

"Abdul" wrote in message
ps.com...
Hello,

Do any have a finction which will enable to convert date from Gregorian
to Hijri and Vise Versa?

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Conversion Terry Excel Discussion (Misc queries) 1 March 18th 10 07:27 PM
Date Conversion Pat Excel Discussion (Misc queries) 3 March 8th 08 10:52 PM
Date Conversion Port Man Excel Discussion (Misc queries) 2 March 1st 07 06:40 PM
Date Conversion JD McLeod Excel Worksheet Functions 1 June 17th 05 01:07 PM
date conversion rdunne Excel Worksheet Functions 2 April 12th 05 10:41 PM


All times are GMT +1. The time now is 10:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"