אופיס 365 פונקציה להמרת תאריך לועזי לעברי ולהיפך באקסס

  • הוסף לסימניות
  • #1
יש למישהו כזה קוד?

יש 2 פקדים אחד עברי ואחד לועזי ואני רוצה שאחד יעדכן את השני אחרי העדכון.


כמובן שמדובר בטופס מאוגד.
 
  • הוסף לסימניות
  • #2
הנה קוד מכאן:

קוד:
Option Explicit



 ' This code demonstrates how to convert a Hebrew date into a
 ' Gregorian date. The code is written in VB6/VBA, but I purposely
 ' used very generic features so it would be easy to translate
 ' this into other languages. Also, I avoided using many
 ' optimization in order to make the logic clearer.

 ' These functions assume that all the current rules of the
 ' Hebrew calendar were always in existence (which is not true
 ' since the Hebrew calendar was not always fixed) and all the
 ' current rules of the Gregorian calendar were always in existence
 ' (which is not true).

 ' Here is a very brief description of the Hebrew calendar.
 '
 ' The Hebrew calendar is a lunisolar calendar.  This means that
 ' the months are in sync with the moon and the years stay in sync
 ' with the sun.  A solar year is approximately 365.25 days.  A
 ' lunar month is approximately 29.5 days.  Twelve lunar months is
 ' approximately 354 days (12 * 29.5=354).  Thus, a lunar year of
 ' twelve months is 11.25 days shorter than the solar year. To make
 ' up for this shortfall, the Hebrew calendar adds a thirteenth
 ' month to seven years over a nineteen year period. Therefore, over
 ' a nineteen year period, the Hebrew calendar is approximately the
 ' same length as a nineteen year solar calendar.
 '
 ' In order to understand this code, you must know the following
 ' terms:
 '   Molad - new moon. Hebrew months start around the day of the
 '           new moon
 '   Chalakim - 1 / 1080 of an hour or 3 1/3 seconds
 '   Tishrei - the first month of the Hebrew year (at least for
 '             these calculations)
 '   Rosh Hashanah - The Jewish new year which starts on Tishrei 1.
 '
 ' The Hebrew calendar assumes the period of time between one new
 ' moon to the next is 29 days, 12 hours and 793 chalakim. The first
 ' molad after creation occurred on Monday, September, 7th -3760 at 5
 ' hours and 204 chalakim.  Technically, the Gregorian date would be
 ' in the year 3761 BCE because there was no year 0 in the Gregorian
 ' calendar, but we will use the year of -3760.

 ' Sample Usage:
 '    ' Converts AdarB/7/5765 to 4/6/2005
 '    MsgBox(HebToGreg(5765, 7, 26))
 '

 ' This function returns how many months there has been from the
 ' first Molad until the beginning of the year nYearH
Public Function MonSinceFirstMolad(ByVal nYearH As Long) As Long
    Dim nMonSinceFirstMolad As Long

  ' A shortcut to this function can simply be the following formula
  '   Return Int(((235 * nYearH) - 234) / 19)
  ' This formula is found in Remy Landau's website and he
  ' attributes it to Wolfgang Alexander Shochen. I will use a less
  ' optimized function which I believe shows the underlying logic
  ' better.

  ' count how many months there has been in all years up to last
  ' year. The months of this year hasn't happened yet.
  nYearH = nYearH - 1

 
  ' In the 19 year cycle, there will always be 235 months. That
  ' would be 19 years times 12 months plus 7 extra month for the
  ' leap years. (19 * 12) + 7 = 235.

  ' Get how many 19 year cycles there has been and multiply it by
  ' 235

  nMonSinceFirstMolad = Int(nYearH / 19) * 235

  ' Get the remaining years after the last complete 19 year cycle

  nYearH = nYearH Mod 19

  ' Add 12 months for each of those years

  nMonSinceFirstMolad = nMonSinceFirstMolad + (12 * nYearH)

  ' Add the extra months to account for the leap years

  If nYearH >= 17 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 6
  ElseIf nYearH >= 14 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 5
  ElseIf nYearH >= 11 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 4
  ElseIf nYearH >= 8 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 3
  ElseIf nYearH >= 6 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 2
  ElseIf nYearH >= 3 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 1
  End If
 MonSinceFirstMolad = nMonSinceFirstMolad
End Function


 ' This function returns if a given year is a leap year.

Public Function IsLeapYear(ByVal nYearH As Long) As Boolean
  Dim nYearInCycle As Long


  ' Find out which year we are within the cycle.  The 19th year of
  ' the cycle will return 0

  nYearInCycle = nYearH Mod 19
  IsLeapYear = nYearInCycle = 3 Or _
               nYearInCycle = 6 Or _
               nYearInCycle = 8 Or _
               nYearInCycle = 11 Or _
               nYearInCycle = 14 Or _
               nYearInCycle = 17 Or _
               nYearInCycle = 0
End Function


 ' This function figures out the Gregorian Date that corresponds to
 ' the first day of Tishrei, the first month of the Hebrew
 ' calendar, for a given Hebrew year.

Public Function Tishrei1(ByVal nYearH As Long) As Date
  Dim nMonthsSinceFirstMolad As Long
  Dim nChalakim As Long
  Dim nHours As Long
  Dim nDays As Long
  Dim nDayOfWeek As Long
  Dim dTishrei1 As Date


  ' We want to calculate how many days, hours and chalakim it has
  ' been from the time of 0 days, 0 hours and 0 chalakim to the
  ' molad at the beginning of year nYearH.
  '
  ' The period between one new moon to the next is 29 days, 12
  ' hours and 793 chalakim. We must multiply that by the amount
  ' of months that transpired since the first molad. Then we add
  ' the time of the first molad (Monday, 5 hours and 204 chalakim)

  nMonthsSinceFirstMolad = MonSinceFirstMolad(nYearH)
 nChalakim = 793 * nMonthsSinceFirstMolad
  nChalakim = nChalakim + 204

  ' carry the excess Chalakim over to the hours

  nHours = Int(nChalakim / 1080)
  nChalakim = nChalakim Mod 1080

  nHours = nHours + (nMonthsSinceFirstMolad * 12)
  nHours = nHours + 5

  ' carry the excess hours over to the days

  nDays = Int(nHours / 24)
  nHours = nHours Mod 24

  nDays = nDays + (29 * nMonthsSinceFirstMolad)
  nDays = nDays + 2


  ' figure out which day of the week the molad occurs.
  ' Sunday = 1, Moday = 2 ..., Shabbos = 0

  nDayOfWeek = nDays Mod 7


  ' In a perfect world, Rosh Hashanah would be on the day of the
  ' molad. The Hebrew calendar makes four exceptions where we
  ' push off Rosh Hashanah one or two days. This is done to
  ' prevent three situation. Without explaining why, the three
  ' situations are:
  '   1) We don't want Rosh Hashanah to come out on Sunday,
  '      Wednesday or Friday
  '   2) We don't want Rosh Hashanah to be on the day of the
  '      molad if the molad occurs after the beginning of 18th
  '      hour.
  '   3) We want to limit years to specific lengths.  For non-leap
  '      years, we limit it to either 353, 354 or 355 days.  For
  '      leap years, we limit it to either 383, 384 or 385 days.
  '      If setting Rosh Hashanah to the day of the molad will
  '      cause this year, or the previous year to fall outside
  '      these lengths, we push off Rosh Hashanah to get the year
  '      back to a valid length.
  ' This code handles these exceptions.


  If Not IsLeapYear(nYearH) And _
     nDayOfWeek = 3 And _
     (nHours * 1080) + nChalakim >= _
     (9 * 1080) + 204 Then

    ' This prevents the year from being 356 days. We have to push
    ' Rosh Hashanah off two days because if we pushed it off only
    ' one day, Rosh Hashanah would comes out on a Wednesday. Check
    ' the Hebrew year 5745 for an example.

    nDayOfWeek = 5
    nDays = nDays + 2
  ElseIf IsLeapYear(nYearH - 1) And _
         nDayOfWeek = 2 And _
         (nHours * 1080) + nChalakim >= _
         (15 * 1080) + 589 Then

    ' This prevents the previous year from being 382 days. Check
    ' the Hebrew Year 5766 for an example. If Rosh Hashanah was not
    ' pushed off a day then 5765 would be 382 days

    nDayOfWeek = 3
    nDays = nDays + 1
  Else

    ' see rule 2 above. Check the Hebrew year 5765 for an example

    If nHours >= 18 Then
      nDayOfWeek = nDayOfWeek + 1
      nDayOfWeek = nDayOfWeek Mod 7
      nDays = nDays + 1
    End If

    ' see rule 1 above. Check the Hebrew year 5765 for an example

    If nDayOfWeek = 1 Or _
       nDayOfWeek = 4 Or _
       nDayOfWeek = 6 Then
      nDayOfWeek = nDayOfWeek + 1
      nDayOfWeek = nDayOfWeek Mod 7
      nDays = nDays + 1
    End If
  End If


  ' Here we want to add nDays to creation
  '    dTishrie1 = creation + nDays
  ' Unfortunately, VB doesn't handle negative years very well.
  ' I therefore picked a Random date (1/1/1900) and figured out how
  ' many days it is after the creation (2067025). Then I subtracted
  ' 2067025 from nDays.

  nDays = nDays - 2067025
  dTishrei1 = #1/1/1900#
 ' 2067025 days after creation
 dTishrei1 = dTishrei1 + nDays
 Tishrei1 = dTishrei1
End Function


 ' This function gets the length of a Hebrew year.

Public Function LengthOfYear(ByVal nYearH As Long) As Long
  Dim dThisTishrei1 As Date
  Dim dNextTishrei1 As Date
  Dim diff As Long


  ' subtract the date of this year from the date of next year

  dThisTishrei1 = Tishrei1(nYearH)
  dNextTishrei1 = Tishrei1(nYearH + 1)
 diff = dNextTishrei1 - dThisTishrei1
 LengthOfYear = diff
End Function


 ' This function converts a Hebrew date into the Gregorian date
 ' nYearH - is the Hebrew year
 ' nMonth - Tishrei=1
 '          Cheshvon=2
 '          Kislev=3
 '          Teyvet=4
 '          Shevat=5
 '          Adar A=6 (only valid on leap years)
 '          Adar=7   (Adar B for leap years)
 '          Nison=8
 '          Iyar=9
 '          Sivan=10
 '          Tamuz=11
 '          Av=12
 '          Elul=13

Public Function HebToGreg(ByVal nYearH As Long, _
                          ByVal nMonthH As Long, _
                          ByVal nDateH As Long) As Date
                          
  Dim nLengthOfYear As Long
  Dim bLeap As Boolean
  Dim dGreg As Date
  Dim nMonth As Long
  Dim nMonthLen As Long
  Dim bHaser As Boolean
  Dim bShalem As Boolean

  bLeap = IsLeapYear(nYearH)
  nLengthOfYear = LengthOfYear(nYearH)


  ' The regular length of a non-leap year is 354 days.
  ' The regular length of a leap year is 384 days.
  ' On regular years, the length of the months are as follows
  '   Tishrei (1)   30
  '   Cheshvon(2)   29
  '   Kislev  (3)   30
  '   Teyvet  (4)   29
  '   Shevat  (5)   30
  '   Adar A  (6)   30     (only valid on leap years)
  '   Adar    (7)   29     (Adar B for leap years)
  '   Nison   (8)   30
  '   Iyar    (9)   29
  '   Sivan   (10)  30
  '   Tamuz   (11)  29
  '   Av      (12)  30
  '   Elul    (13)  29
  ' If the year is shorter by one less day, it is called a haser
  ' year. Kislev on a haser year has 29 days. If the year is longer
  ' by one day, it is called a shalem year. Cheshvon on a shalem
  ' year is 30 days.

  bHaser = nLengthOfYear = 353 Or nLengthOfYear = 383
  bShalem = nLengthOfYear = 355 Or nLengthOfYear = 385

  ' get the date for Tishrei 1

  dGreg = Tishrei1(nYearH)
  ' Now count up days within the year

  For nMonth = 1 To nMonthH - 1
    Select Case nMonth
      Case 1, 5, 8, 10, 12 ' 30 day months
        nMonthLen = 30
      Case 4, 7, 9, 11, 13 ' 29 day months
        nMonthLen = 29
      Case 6 ' There is only an Adar A on a leap years
        nMonthLen = IIf(bLeap, 30, 0)
      Case 2 ' Cheshvon, see note above
        nMonthLen = IIf(bShalem, 30, 29)
      Case 3 ' Kislev, see note above
        nMonthLen = IIf(bHaser, 29, 30)
    End Select
 dGreg = dGreg + nMonthLen
  Next
  dGreg = dGreg + (nDateH - 1)
 HebToGreg = dGreg
End Function


 ' This function converts a Gregorian date into the Hebrew date.  The
 ' function returns the hebrew month as a string in the format MM/DD/YYYY.
 ' Also, the parameters nYearH, nMonthH and hDateH, which are sent by
 ' reference, will get set the Hebrew year, month and date. See function
 ' HebToGreg() for the definition of the month numbers.

Public Function GregToHeb(ByVal dGreg As Date, _
                          ByRef nYearH As Long, _
                          ByRef nMonthH As Long, _
                          ByRef nDateH As Long) As String
                          
  Dim nOneMolad As Double
  Dim nAvrgYear As Double
  Dim nDays As Long
  Dim dTishrei1 As Date
  Dim nLengthOfYear As Long
  Dim bLeap As Boolean
  Dim bHaser As Boolean
  Dim bShalem As Boolean
  Dim nMonthLen As Long
  Dim bWhile As Boolean


  ' The basic algorythm to get Hebrew date for the Gregorian date dGreg.
  ' 1) Find out how many days dGreg is after creation.
  ' 2) Based on those days, estimate the Hebrew year
  ' 3) Now that we a good estimate of the Hebrew year, use brute force to
  '    find the Gregorian date for Tishrei 1 prior to or equal to dGreg
  ' 4) Add to Tishrei 1 the amount of days dGreg is after Tishrei 1

  ' Figure out how many days are in a month.
  ' 29 days + 12 hours + 793 chalakim

  nOneMolad = 29 + (12 / 24) + (793 / (1080 * 24))

  ' Figure out the average length of a year. The hebrew year has exactly
  ' 235 months over 19 years.

  nAvrgYear = nOneMolad * (235 / 19)

  ' Get how many days dGreg is after creation. See note as to why I
  ' use 1/1/1900 and add 2067025

  nDays = dGreg - #1/1/1900#
 nDays = nDays + 2067025  ' 2067025 days after creation
  ' Guess the Hebrew year. This should be a pretty accurate guess.

  nYearH = Int(CDbl(nDays) / nAvrgYear) + 1

  ' Use brute force to find the exact year nYearH. It is the Tishrei 1 in
  ' the year <= dGreg.

  dTishrei1 = Tishrei1(nYearH)
  If dTishrei1 = dGreg Then

    ' If we got lucky and landed on the exact date, we can stop here

    nMonthH = 1
    nDateH = 1
  Else

    ' Here is the brute force.  Either count up or count down nYearH
    ' until Tishrei 1 is <= dGreg.

    If dTishrei1 < dGreg Then

      ' If Tishrei 1, nYearH is less than dGreg, count nYearH up.

      Do While Tishrei1(nYearH + 1) <= dGreg
        nYearH = nYearH + 1
      Loop
    Else

      ' If Tishrei 1, nYearH is greater than dGreg, count nYearH down.

      nYearH = nYearH - 1
      Do While Tishrei1(nYearH) > dGreg
        nYearH = nYearH - 1
      Loop
    End If


    ' Subtract Tishrei 1, nYearH from dGreg. That should leave us with
    ' how many days we have to add to Tishrei 1

    nDays = dGreg - Tishrei1(nYearH)


    ' Find out what type of year it is so that we know the length of the
    ' months

    nLengthOfYear = LengthOfYear(nYearH)
    bHaser = nLengthOfYear = 353 Or nLengthOfYear = 383
    bShalem = nLengthOfYear = 355 Or nLengthOfYear = 385
    bLeap = IsLeapYear(nYearH)


    ' Add nDays to Tishrei 1.

    nMonthH = 1
    Do
      Select Case nMonthH
        Case 1, 5, 8, 10, 12 ' 30 day months
          nMonthLen = 30
        Case 4, 7, 9, 11, 13 ' 29 day months
          nMonthLen = 29
        Case 6 ' Adar A (6) will be skipped on non-leap years
          nMonthLen = 30
        Case 2 ' Cheshvon, see note above
          nMonthLen = IIf(bShalem, 30, 29)
        Case 3 ' Kislev, see note above
          nMonthLen = IIf(bHaser, 29, 30)
      End Select
      If nDays >= nMonthLen Then
 bWhile = True
        If bLeap Or nMonthH <> 5 Then
          nMonthH = nMonthH + 1
        Else

          ' We can skip Adar A (6) if its not a leap year

          nMonthH = nMonthH + 2
        End If
 nDays = nDays - nMonthLen
      Else
 bWhile = False
      End If
    Loop While bWhile

    ' Add the remaining days to Date

    nDateH = nDays + 1
  End If
  GregToHeb = CStr(nMonthH) & "/" & CStr(nDateH) & "/" & CStr(nYearH)
End Function

Public Function FormatDateH(nYearH, nMonthH, nDateH)
  Dim sMonth As String
  Select Case nMonthH
    Case 1
      sMonth = "תשרי"
    Case 2
      sMonth = "חשוון"
    Case 3
      sMonth = "כסלו"
    Case 4
      sMonth = "טבת"
    Case 5
      sMonth = "שבט"
    Case 6
      sMonth = "אדר א'"
    Case 7
      sMonth = IIf(IsLeapYear(nYearH), "אדר ב'", "אדר")
    Case 8
      sMonth = "ניסן"
    Case 9
      sMonth = "אייר"
    Case 10
      sMonth = "סיוון"
    Case 11
      sMonth = "תמוז"
    Case 12
      sMonth = "אב"
    Case 13
      sMonth = "אלול"
  End Select
  FormatDateH = CStr(HebrewNum(nDateH)) _
  & " " & sMonth & " " & CStr(HebrewNum(nYearH))
End Function

Public Function TodayHeb()
  Dim nYearH As Long
  Dim nMonthH As Long
  Dim nDateH As Long
  Dim dToday As Date
 
  dToday = Int(Now())
  GregToHeb dToday, nYearH, nMonthH, nDateH
  TodayHeb = FormatDateH(nYearH, nMonthH, nDateH)
End Function

Public Function DateToHeb(dDate)
  Dim nYearH As Long
  Dim nMonthH As Long
  Dim nDateH As Long
 
  dDate = CDate(dDate)
  GregToHeb dDate, nYearH, nMonthH, nDateH
  DateToHeb = FormatDateH(nYearH, nMonthH, nDateH)
End Function



Function HebrewNum(ByVal n As Integer)
  Dim nX As Integer
  Dim sHundred As String
  Dim sTen As String
  Dim sOne As String
 
  n = n Mod 1000
  nX = n - (n Mod 100)
  Select Case nX
    Case 900
      sHundred = Tuf_() & Tuf_() & Raish_()
    Case 800
      sHundred = Tuf_() & Tuf_() & Kuf_()
    Case 700
      sHundred = Tuf_() & Shin_()
    Case 600
      sHundred = Tuf_() & Raish_()
    Case 500
      sHundred = Tuf_() & Kuf_()
    Case 400
      sHundred = Tuf_()
    Case 300
      sHundred = Shin_()
    Case 200
      sHundred = Raish_()
    Case 100
      sHundred = Kuf_()
  End Select
 n = n - nX
  If n = 15 Then
    sTen = Tes_()
    sOne = Vav_()
  ElseIf n = 16 Then
    sTen = Tes_()
    sOne = Ziyon_()
  Else
    nX = n - (n Mod 10)
    Select Case nX
      Case 90
        sTen = Tzodi_()
      Case 80
        sTen = Pai_()
      Case 70
        sTen = Iyin_()
      Case 60
        sTen = Samech_()
      Case 50
        sTen = Nun_()
      Case 40
        sTen = Mem_()
      Case 30
        sTen = Lamed_()
      Case 20
        sTen = Chaf_()
      Case 10
        sTen = Yud_()
    End Select
 nX = n - nX
    Select Case nX
      Case 9
        sOne = Tes_()
      Case 8
        sOne = Ches_()
      Case 7
        sOne = Ziyon_()
      Case 6
        sOne = Vav_()
      Case 5
        sOne = Hai_()
      Case 4
        sOne = Daled_()
      Case 3
        sOne = Gimmel_()
      Case 2
        sOne = Bais_()
      Case 1
        sOne = Alef_()
    End Select
  End If
 
 HebrewNum = sHundred & sTen & sOne
End Function

Public Function FormatDateHInHeb(nYearH, nMonthH, nDateH)
  Dim sMonth As String
  Select Case nMonthH
    Case 1
      sMonth = Tuf_() & Shin_() & Raish_() & Yud_()
    Case 2
      sMonth = Ches_() & Shin_() & Vav_() & Nun_End_()
    Case 3
      sMonth = Chaf_() & Samech_() & Lamed_() & Yud_() & Vav_()
    Case 4
      sMonth = Tes_() & Bais_() & Tuf_()
    Case 5
      sMonth = Shin_() & Bais_() & Tes_()
    Case 6
      sMonth = Alef_() & Daled_() & Raish_() & ChrW(32) & Alef_()
    Case 7
      sMonth = IIf(IsLeapYear(nYearH), _
                     Alef_() & Daled_() & Raish_() & ChrW(32) & Bais_(), _
                     Alef_() & Daled_() & Raish_())
    Case 8
      sMonth = Nun_() & Yud_() & Samech_() & Nun_End_()
    Case 9
      sMonth = Alef_() & Yud_() & Yud_() & Raish_()
    Case 10
      sMonth = Samech_() & Yud_() & Vav_() & Nun_End_()
    Case 11
      sMonth = Tuf_() & Mem_() & Vav_() & Ziyon_()
    Case 12
      sMonth = Alef_() & Bais_()
    Case 13
      sMonth = Alef_() & Lamed_() & Vav_() & Lamed_()
  End Select
  FormatDateHInHeb = sMonth & " " & HebrewNum(nDateH) & " " & CStr(nYearH)
 
  ' FormatDateHInHeb = sMonth & " " & HebrewNum(nDateH) & " " & HebrewNum(nYearH)
 
 
End Function


Public Function HebDateInHeb(dDate)
  Dim nYearH As Long
  Dim nMonthH As Long
  Dim nDateH As Long
 
  dDate = CDate(dDate)
  GregToHeb dDate, nYearH, nMonthH, nDateH
  HebDateInHeb = FormatDateHInHeb(nYearH, nMonthH, nDateH)
End Function

Function Alef_()
  Alef_ = ChrW(1488)
End Function

Function Bais_()
  Bais_ = ChrW(1489)
End Function

Function Gimmel_()
  Gimmel_ = ChrW(1490)
End Function

Function Daled_()
  Daled_ = ChrW(1491)
End Function

Function Hai_()
  Hai_ = ChrW(1492)
End Function

Function Vav_()
  Vav_ = ChrW(1493)
End Function

Function Ziyon_()
  Ziyon_ = ChrW(1494)
End Function

Function Ches_()
  Ches_ = ChrW(1495)
End Function

Function Tes_()
  Tes_ = ChrW(1496)
End Function

Function Yud_()
  Yud_ = ChrW(1497)
End Function

Function Chaf_End_()
  Chaf_End_ = ChrW(1498)
End Function

Function Chaf_()
  Chaf_ = ChrW(1499)
End Function

Function Lamed_()
  Lamed_ = ChrW(1500)
End Function

Function Mem_End_()
  Mem_End_ = ChrW(1501)
End Function

Function Mem_()
Mem_ = ChrW(1502)
End Function

Function Nun_End_()
   Nun_End_ = ChrW(1503)
End Function

Function Nun_()
  Nun_ = ChrW(1504)
End Function

Function Samech_()
  Samech_ = ChrW(1505)
End Function

Function Iyin_()
  Iyin_ = ChrW(1506)
End Function

Function Pai_End_()
  Pai_End_ = ChrW(1507)
End Function

Function Pai_()
  Pai_ = ChrW(1508)
End Function

Function Tzodi_End_()
  Tzodi_End_ = ChrW(1509)
End Function

Function Tzodi_()
  Tzodi_ = ChrW(1510)
End Function

Function Kuf_()
  Kuf_ = ChrW(1511)
End Function

Function Raish_()
  Raish_ = ChrW(1512)
End Function

Function Shin_()
  Shin_ = ChrW(1513)
End Function

Function Tuf_()
  Tuf_ = ChrW(1514)
End Function

Function UnicodeChar(n As Integer)
  UnicodeChar = ChrW(n)
End Function


 ' Some handy code to help generate code

Public Sub MakeHebrewLet()
  Dim nRow As Integer
 Sheets.Add
  ActiveSheet.Name = "HebrewLet"
  For nRow = 1 To 27
    Cells(nRow, 1) = nRow + 1487
    Cells(nRow, 2) = ChrW(nRow + 1487)
    Select Case nRow
      Case 1
        Cells(nRow, 3) = "Alef"
      Case 2
        Cells(nRow, 3) = "Bais"
      Case 3
        Cells(nRow, 3) = "Gimmel"
      Case 4
        Cells(nRow, 3) = "Daled"
      Case 5
        Cells(nRow, 3) = "Hai"
      Case 6
        Cells(nRow, 3) = "Vav"
      Case 7
        Cells(nRow, 3) = "Ziyon"
      Case 8
        Cells(nRow, 3) = "Ches"
      Case 9
        Cells(nRow, 3) = "Tes"
      Case 10
        Cells(nRow, 3) = "Yud"
      Case 11
        Cells(nRow, 3) = "Chaf_End"
      Case 12
        Cells(nRow, 3) = "Chaf"
      Case 13
        Cells(nRow, 3) = "Lamed"
      Case 14
        Cells(nRow, 3) = "Mem_End"
      Case 15
        Cells(nRow, 3) = "Mem"
      Case 16
        Cells(nRow, 3) = "Nun_End"
      Case 17
        Cells(nRow, 3) = "Nun"
      Case 18
        Cells(nRow, 3) = "Samech"
      Case 19
        Cells(nRow, 3) = "Iyin"
      Case 20
        Cells(nRow, 3) = "Pai_End"
      Case 21
        Cells(nRow, 3) = "Pai"
      Case 22
        Cells(nRow, 3) = "Tzodi_End"
      Case 23
        Cells(nRow, 3) = "Tzodi"
      Case 24
        Cells(nRow, 3) = "Kuf"
      Case 25
        Cells(nRow, 3) = "Raish"
      Case 26
        Cells(nRow, 3) = "Shin"
      Case 27
        Cells(nRow, 3) = "Tuf"
    End Select
  Next
End Sub

Public Function HebSt(S As String)
  Dim n As Integer
 

  For n = 1 To Len(S)
    If n <> 1 Then
      HebSt = HebSt + " & "
    End If
    HebSt = HebSt + HebLetToFunc(Mid(S, n, 1))
  Next
End Function

Function HebLetToFunc(sHebLet As String) As String
  Dim nRow As Integer
  HebLetToFunc = "ChrW(" + CStr(AscW(sHebLet)) & ")"
  nRow = 1
  Do While Sheets("HebrewLet").Cells(nRow, 2) <> ""
    If Sheets("HebrewLet").Cells(nRow, 2) = sHebLet Then
      HebLetToFunc = Sheets("HebrewLet").Cells(nRow, 3) & "_()"
      Exit Do
    End If
    nRow = nRow + 1
  Loop
End Function
 
  • הוסף לסימניות
  • #3
נכתב ע"י Rרחמים;1045330:

תודה, הרעיון עבד לי.
עשיתי שתי פקדים ובאחד עשיתי מקור פקד =DateToHeb([תאריךלועזי])
וזה עבד.

עכשיו;
מה אני עושה כשאני רוצה שהוא יעדכן את התאריך לאחר עדכון התאריך הלועזי.
אני צריך לרשום קוד 'לאחר עדכון'? מה אני רושם שם?

כמו"כ להיפך מתאריך עברי שהוא ימיר ללועזי, לא מצאתי שם משהו. באם יש מה זה? וכנ"ל מה אני רושם לאחר עדכון?

תודה רבה רבה
 
  • הוסף לסימניות
  • #4
HebToGreg ממיר מעברי ללועזי
 
  • הוסף לסימניות
  • #5
נכתב ע"י Rרחמים;1045380:
HebToGreg ממיר מעברי ללועזי

הוא דורש 3 ארגמנטים.
פקד ליום - חודש - שנה. לא? ניסיתי את כל האפשרויות ולא הסתדר לי .

כמו"כ איך אני עושה שלאחר העדכון הוא יעדכן את זה, עם משתנה?
באם כן מה אני רושם?
ובאם לא, אז איך?

מדובר בטופס מאוגד, כך שמקור הפקד שייך לטבלה/שאילתה, ואני צריך שהוא יתעדכן
 
  • הוסף לסימניות
  • #6
הוא דורש 3 ארגמנטים.
פקד ליום - חודש - שנה. לא? ניסיתי את כל האפשרויות ולא הסתדר לי .

ראה בקובץ אקסל המצורף הכל מפרוש בו
[הצרכתי להוסיף כמה פקודות להפוך תאריך עברי למספור - וכן פקודה שיבחין באלפים]
 

קבצים מצורפים

  • תאריך לתאריך.zip
    KB 48.6 · צפיות: 129
  • הוסף לסימניות
  • #7
נכתב ע"י ayg;1046112:
ראה בקובץ אקסל המצורף הכל מפרוש בו
[הצרכתי להוסיף כמה פקודות להפוך תאריך עברי למספור - וכן פקודה שיבחין באלפים]

הוא עובד רק לפני עדכון.
ברגע שאני מחליף תאריך עברי הוא מפסיק לעדכן.

כמו"כ אני צריך את זה לאקסס לא לאקסל
 
  • הוסף לסימניות
  • #8
בבקשה, ראה את המצורף.

ההמרה מתבצעת או לאחר עדכון אחד מתיבות הטקסט או ע"י לחיצה על הכפתור.
יש בו שני שיטות המרה, אחד מבוסס על הקוד שרחמים שיתף (בתוספת כמה פונקציות), והשני הוא הקוד שפורסם כבר באשכול אחר בזמן האחרון, וד"ל.
 

קבצים מצורפים

  • המרת תאריכים.rar
    KB 70.8 · צפיות: 138
  • הוסף לסימניות
  • #9
תודה ענקית, עובד מצויין.

חן חן לך.
 
  • הוסף לסימניות
  • #10
סתם נקודה למחשבה שראיתי עכשיו.
אני כבר לא רוצה שמוישי ישרוף לזה זמן.
הוא לא מטפל בשגיאות הקלדה, לדוגמא אם אני רושם מ' תמוז תשע"ג
הוא מחזיר את התאריך של י'א אב (בלועזי, את העברי הוא משאיר כך...... )
וכו'
רק למחשבה, מוישי, אל תטפל בזה בשבילי.........
 
  • הוסף לסימניות
  • #11
נכתב ע"י a26955;1047180:
תודה ענקית, עובד מצויין.

חן חן לך.

גם אני מצטרף!
מוישי תזכה למצוות!
 
  • הוסף לסימניות
  • #12
נכתב ע"י moishy;1047102:
בבקשה, ראה את המצורף.

ההמרה מתבצעת או לאחר עדכון אחד מתיבות הטקסט או ע"י לחיצה על הכפתור.
יש בו שני שיטות המרה, אחד מבוסס על הקוד שרחמים שיתף (בתוספת כמה פונקציות), והשני הוא הקוד שפורסם כבר באשכול אחר בזמן האחרון, וד"ל.

עובד מצוין!!
 
  • הוסף לסימניות
  • #13
מצ"ב תכנה חינמית בעלת ממשק משתמש יפה, ממירה תאריך עברי ללועזי וגם תאריך לועזי לעברי.
התכנה גם מאפשרת להדפיס את התאריכים שהומרו.
התכנה נוצרה לחלונות 95/98/Me. מתאימה גם ל-xp.
אבל אם הנכם משתמשים ב-win7 - כדי להפעיל את התכנה יש תחילה ללחוץ על סמליל התכנה בלחצן ימני, לבחור "מאפיינים"-->"תאימות"-->לסמן תיבה סימון "הפעל תוכנית זו במצב תאימות עבור: Win98/Me".
ראו גם קישור זה: http://www.dr-vb.co.il/showcat.php?id=5&page=2
 

קבצים מצורפים

  • HebrewCalendar.zip
    1.1 MB · צפיות: 78
  • הוסף לסימניות
  • #14
הקוד בVB

נכתב ע"י moishy;1047102:
בבקשה, ראה את המצורף.

ההמרה מתבצעת או לאחר עדכון אחד מתיבות הטקסט או ע"י לחיצה על הכפתור.
יש בו שני שיטות המרה, אחד מבוסס על הקוד שרחמים שיתף (בתוספת כמה פונקציות), והשני הוא הקוד שפורסם כבר באשכול אחר בזמן האחרון, וד"ל.

נפלא!!!
האם שייך שתעלה הקוד גם בשפת VB?
[הגדרת המשתנים בVB והשימוש בהם שונה מVBA, ואי אפשר להשתמש שם בקוד זה]
תודה מראש
 
  • הוסף לסימניות
  • #15
הנה קוד מכאן:

קוד:
Option Explicit



 ' This code demonstrates how to convert a Hebrew date into a
 ' Gregorian date. The code is written in VB6/VBA, but I purposely
 ' used very generic features so it would be easy to translate
 ' this into other languages. Also, I avoided using many
 ' optimization in order to make the logic clearer.

 ' These functions assume that all the current rules of the
 ' Hebrew calendar were always in existence (which is not true
 ' since the Hebrew calendar was not always fixed) and all the
 ' current rules of the Gregorian calendar were always in existence
 ' (which is not true).

 ' Here is a very brief description of the Hebrew calendar.
 '
 ' The Hebrew calendar is a lunisolar calendar.  This means that
 ' the months are in sync with the moon and the years stay in sync
 ' with the sun.  A solar year is approximately 365.25 days.  A
 ' lunar month is approximately 29.5 days.  Twelve lunar months is
 ' approximately 354 days (12 * 29.5=354).  Thus, a lunar year of
 ' twelve months is 11.25 days shorter than the solar year. To make
 ' up for this shortfall, the Hebrew calendar adds a thirteenth
 ' month to seven years over a nineteen year period. Therefore, over
 ' a nineteen year period, the Hebrew calendar is approximately the
 ' same length as a nineteen year solar calendar.
 '
 ' In order to understand this code, you must know the following
 ' terms:
 '   Molad - new moon. Hebrew months start around the day of the
 '           new moon
 '   Chalakim - 1 / 1080 of an hour or 3 1/3 seconds
 '   Tishrei - the first month of the Hebrew year (at least for
 '             these calculations)
 '   Rosh Hashanah - The Jewish new year which starts on Tishrei 1.
 '
 ' The Hebrew calendar assumes the period of time between one new
 ' moon to the next is 29 days, 12 hours and 793 chalakim. The first
 ' molad after creation occurred on Monday, September, 7th -3760 at 5
 ' hours and 204 chalakim.  Technically, the Gregorian date would be
 ' in the year 3761 BCE because there was no year 0 in the Gregorian
 ' calendar, but we will use the year of -3760.

 ' Sample Usage:
 '    ' Converts AdarB/7/5765 to 4/6/2005
 '    MsgBox(HebToGreg(5765, 7, 26))
 '

 ' This function returns how many months there has been from the
 ' first Molad until the beginning of the year nYearH
Public Function MonSinceFirstMolad(ByVal nYearH As Long) As Long
    Dim nMonSinceFirstMolad As Long

  ' A shortcut to this function can simply be the following formula
  '   Return Int(((235 * nYearH) - 234) / 19)
  ' This formula is found in Remy Landau's website and he
  ' attributes it to Wolfgang Alexander Shochen. I will use a less
  ' optimized function which I believe shows the underlying logic
  ' better.

  ' count how many months there has been in all years up to last
  ' year. The months of this year hasn't happened yet.
  nYearH = nYearH - 1

 
  ' In the 19 year cycle, there will always be 235 months. That
  ' would be 19 years times 12 months plus 7 extra month for the
  ' leap years. (19 * 12) + 7 = 235.

  ' Get how many 19 year cycles there has been and multiply it by
  ' 235

  nMonSinceFirstMolad = Int(nYearH / 19) * 235

  ' Get the remaining years after the last complete 19 year cycle

  nYearH = nYearH Mod 19

  ' Add 12 months for each of those years

  nMonSinceFirstMolad = nMonSinceFirstMolad + (12 * nYearH)

  ' Add the extra months to account for the leap years

  If nYearH >= 17 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 6
  ElseIf nYearH >= 14 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 5
  ElseIf nYearH >= 11 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 4
  ElseIf nYearH >= 8 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 3
  ElseIf nYearH >= 6 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 2
  ElseIf nYearH >= 3 Then
    nMonSinceFirstMolad = nMonSinceFirstMolad + 1
  End If
 MonSinceFirstMolad = nMonSinceFirstMolad
End Function


 ' This function returns if a given year is a leap year.

Public Function IsLeapYear(ByVal nYearH As Long) As Boolean
  Dim nYearInCycle As Long


  ' Find out which year we are within the cycle.  The 19th year of
  ' the cycle will return 0

  nYearInCycle = nYearH Mod 19
  IsLeapYear = nYearInCycle = 3 Or _
               nYearInCycle = 6 Or _
               nYearInCycle = 8 Or _
               nYearInCycle = 11 Or _
               nYearInCycle = 14 Or _
               nYearInCycle = 17 Or _
               nYearInCycle = 0
End Function


 ' This function figures out the Gregorian Date that corresponds to
 ' the first day of Tishrei, the first month of the Hebrew
 ' calendar, for a given Hebrew year.

Public Function Tishrei1(ByVal nYearH As Long) As Date
  Dim nMonthsSinceFirstMolad As Long
  Dim nChalakim As Long
  Dim nHours As Long
  Dim nDays As Long
  Dim nDayOfWeek As Long
  Dim dTishrei1 As Date


  ' We want to calculate how many days, hours and chalakim it has
  ' been from the time of 0 days, 0 hours and 0 chalakim to the
  ' molad at the beginning of year nYearH.
  '
  ' The period between one new moon to the next is 29 days, 12
  ' hours and 793 chalakim. We must multiply that by the amount
  ' of months that transpired since the first molad. Then we add
  ' the time of the first molad (Monday, 5 hours and 204 chalakim)

  nMonthsSinceFirstMolad = MonSinceFirstMolad(nYearH)
 nChalakim = 793 * nMonthsSinceFirstMolad
  nChalakim = nChalakim + 204

  ' carry the excess Chalakim over to the hours

  nHours = Int(nChalakim / 1080)
  nChalakim = nChalakim Mod 1080

  nHours = nHours + (nMonthsSinceFirstMolad * 12)
  nHours = nHours + 5

  ' carry the excess hours over to the days

  nDays = Int(nHours / 24)
  nHours = nHours Mod 24

  nDays = nDays + (29 * nMonthsSinceFirstMolad)
  nDays = nDays + 2


  ' figure out which day of the week the molad occurs.
  ' Sunday = 1, Moday = 2 ..., Shabbos = 0

  nDayOfWeek = nDays Mod 7


  ' In a perfect world, Rosh Hashanah would be on the day of the
  ' molad. The Hebrew calendar makes four exceptions where we
  ' push off Rosh Hashanah one or two days. This is done to
  ' prevent three situation. Without explaining why, the three
  ' situations are:
  '   1) We don't want Rosh Hashanah to come out on Sunday,
  '      Wednesday or Friday
  '   2) We don't want Rosh Hashanah to be on the day of the
  '      molad if the molad occurs after the beginning of 18th
  '      hour.
  '   3) We want to limit years to specific lengths.  For non-leap
  '      years, we limit it to either 353, 354 or 355 days.  For
  '      leap years, we limit it to either 383, 384 or 385 days.
  '      If setting Rosh Hashanah to the day of the molad will
  '      cause this year, or the previous year to fall outside
  '      these lengths, we push off Rosh Hashanah to get the year
  '      back to a valid length.
  ' This code handles these exceptions.


  If Not IsLeapYear(nYearH) And _
     nDayOfWeek = 3 And _
     (nHours * 1080) + nChalakim >= _
     (9 * 1080) + 204 Then

    ' This prevents the year from being 356 days. We have to push
    ' Rosh Hashanah off two days because if we pushed it off only
    ' one day, Rosh Hashanah would comes out on a Wednesday. Check
    ' the Hebrew year 5745 for an example.

    nDayOfWeek = 5
    nDays = nDays + 2
  ElseIf IsLeapYear(nYearH - 1) And _
         nDayOfWeek = 2 And _
         (nHours * 1080) + nChalakim >= _
         (15 * 1080) + 589 Then

    ' This prevents the previous year from being 382 days. Check
    ' the Hebrew Year 5766 for an example. If Rosh Hashanah was not
    ' pushed off a day then 5765 would be 382 days

    nDayOfWeek = 3
    nDays = nDays + 1
  Else

    ' see rule 2 above. Check the Hebrew year 5765 for an example

    If nHours >= 18 Then
      nDayOfWeek = nDayOfWeek + 1
      nDayOfWeek = nDayOfWeek Mod 7
      nDays = nDays + 1
    End If

    ' see rule 1 above. Check the Hebrew year 5765 for an example

    If nDayOfWeek = 1 Or _
       nDayOfWeek = 4 Or _
       nDayOfWeek = 6 Then
      nDayOfWeek = nDayOfWeek + 1
      nDayOfWeek = nDayOfWeek Mod 7
      nDays = nDays + 1
    End If
  End If


  ' Here we want to add nDays to creation
  '    dTishrie1 = creation + nDays
  ' Unfortunately, VB doesn't handle negative years very well.
  ' I therefore picked a Random date (1/1/1900) and figured out how
  ' many days it is after the creation (2067025). Then I subtracted
  ' 2067025 from nDays.

  nDays = nDays - 2067025
  dTishrei1 = #1/1/1900#
 ' 2067025 days after creation
 dTishrei1 = dTishrei1 + nDays
 Tishrei1 = dTishrei1
End Function


 ' This function gets the length of a Hebrew year.

Public Function LengthOfYear(ByVal nYearH As Long) As Long
  Dim dThisTishrei1 As Date
  Dim dNextTishrei1 As Date
  Dim diff As Long


  ' subtract the date of this year from the date of next year

  dThisTishrei1 = Tishrei1(nYearH)
  dNextTishrei1 = Tishrei1(nYearH + 1)
 diff = dNextTishrei1 - dThisTishrei1
 LengthOfYear = diff
End Function


 ' This function converts a Hebrew date into the Gregorian date
 ' nYearH - is the Hebrew year
 ' nMonth - Tishrei=1
 '          Cheshvon=2
 '          Kislev=3
 '          Teyvet=4
 '          Shevat=5
 '          Adar A=6 (only valid on leap years)
 '          Adar=7   (Adar B for leap years)
 '          Nison=8
 '          Iyar=9
 '          Sivan=10
 '          Tamuz=11
 '          Av=12
 '          Elul=13

Public Function HebToGreg(ByVal nYearH As Long, _
                          ByVal nMonthH As Long, _
                          ByVal nDateH As Long) As Date
                         
  Dim nLengthOfYear As Long
  Dim bLeap As Boolean
  Dim dGreg As Date
  Dim nMonth As Long
  Dim nMonthLen As Long
  Dim bHaser As Boolean
  Dim bShalem As Boolean

  bLeap = IsLeapYear(nYearH)
  nLengthOfYear = LengthOfYear(nYearH)


  ' The regular length of a non-leap year is 354 days.
  ' The regular length of a leap year is 384 days.
  ' On regular years, the length of the months are as follows
  '   Tishrei (1)   30
  '   Cheshvon(2)   29
  '   Kislev  (3)   30
  '   Teyvet  (4)   29
  '   Shevat  (5)   30
  '   Adar A  (6)   30     (only valid on leap years)
  '   Adar    (7)   29     (Adar B for leap years)
  '   Nison   (8)   30
  '   Iyar    (9)   29
  '   Sivan   (10)  30
  '   Tamuz   (11)  29
  '   Av      (12)  30
  '   Elul    (13)  29
  ' If the year is shorter by one less day, it is called a haser
  ' year. Kislev on a haser year has 29 days. If the year is longer
  ' by one day, it is called a shalem year. Cheshvon on a shalem
  ' year is 30 days.

  bHaser = nLengthOfYear = 353 Or nLengthOfYear = 383
  bShalem = nLengthOfYear = 355 Or nLengthOfYear = 385

  ' get the date for Tishrei 1

  dGreg = Tishrei1(nYearH)
  ' Now count up days within the year

  For nMonth = 1 To nMonthH - 1
    Select Case nMonth
      Case 1, 5, 8, 10, 12 ' 30 day months
        nMonthLen = 30
      Case 4, 7, 9, 11, 13 ' 29 day months
        nMonthLen = 29
      Case 6 ' There is only an Adar A on a leap years
        nMonthLen = IIf(bLeap, 30, 0)
      Case 2 ' Cheshvon, see note above
        nMonthLen = IIf(bShalem, 30, 29)
      Case 3 ' Kislev, see note above
        nMonthLen = IIf(bHaser, 29, 30)
    End Select
 dGreg = dGreg + nMonthLen
  Next
  dGreg = dGreg + (nDateH - 1)
 HebToGreg = dGreg
End Function


 ' This function converts a Gregorian date into the Hebrew date.  The
 ' function returns the hebrew month as a string in the format MM/DD/YYYY.
 ' Also, the parameters nYearH, nMonthH and hDateH, which are sent by
 ' reference, will get set the Hebrew year, month and date. See function
 ' HebToGreg() for the definition of the month numbers.

Public Function GregToHeb(ByVal dGreg As Date, _
                          ByRef nYearH As Long, _
                          ByRef nMonthH As Long, _
                          ByRef nDateH As Long) As String
                         
  Dim nOneMolad As Double
  Dim nAvrgYear As Double
  Dim nDays As Long
  Dim dTishrei1 As Date
  Dim nLengthOfYear As Long
  Dim bLeap As Boolean
  Dim bHaser As Boolean
  Dim bShalem As Boolean
  Dim nMonthLen As Long
  Dim bWhile As Boolean


  ' The basic algorythm to get Hebrew date for the Gregorian date dGreg.
  ' 1) Find out how many days dGreg is after creation.
  ' 2) Based on those days, estimate the Hebrew year
  ' 3) Now that we a good estimate of the Hebrew year, use brute force to
  '    find the Gregorian date for Tishrei 1 prior to or equal to dGreg
  ' 4) Add to Tishrei 1 the amount of days dGreg is after Tishrei 1

  ' Figure out how many days are in a month.
  ' 29 days + 12 hours + 793 chalakim

  nOneMolad = 29 + (12 / 24) + (793 / (1080 * 24))

  ' Figure out the average length of a year. The hebrew year has exactly
  ' 235 months over 19 years.

  nAvrgYear = nOneMolad * (235 / 19)

  ' Get how many days dGreg is after creation. See note as to why I
  ' use 1/1/1900 and add 2067025

  nDays = dGreg - #1/1/1900#
 nDays = nDays + 2067025  ' 2067025 days after creation
  ' Guess the Hebrew year. This should be a pretty accurate guess.

  nYearH = Int(CDbl(nDays) / nAvrgYear) + 1

  ' Use brute force to find the exact year nYearH. It is the Tishrei 1 in
  ' the year <= dGreg.

  dTishrei1 = Tishrei1(nYearH)
  If dTishrei1 = dGreg Then

    ' If we got lucky and landed on the exact date, we can stop here

    nMonthH = 1
    nDateH = 1
  Else

    ' Here is the brute force.  Either count up or count down nYearH
    ' until Tishrei 1 is <= dGreg.

    If dTishrei1 < dGreg Then

      ' If Tishrei 1, nYearH is less than dGreg, count nYearH up.

      Do While Tishrei1(nYearH + 1) <= dGreg
        nYearH = nYearH + 1
      Loop
    Else

      ' If Tishrei 1, nYearH is greater than dGreg, count nYearH down.

      nYearH = nYearH - 1
      Do While Tishrei1(nYearH) > dGreg
        nYearH = nYearH - 1
      Loop
    End If


    ' Subtract Tishrei 1, nYearH from dGreg. That should leave us with
    ' how many days we have to add to Tishrei 1

    nDays = dGreg - Tishrei1(nYearH)


    ' Find out what type of year it is so that we know the length of the
    ' months

    nLengthOfYear = LengthOfYear(nYearH)
    bHaser = nLengthOfYear = 353 Or nLengthOfYear = 383
    bShalem = nLengthOfYear = 355 Or nLengthOfYear = 385
    bLeap = IsLeapYear(nYearH)


    ' Add nDays to Tishrei 1.

    nMonthH = 1
    Do
      Select Case nMonthH
        Case 1, 5, 8, 10, 12 ' 30 day months
          nMonthLen = 30
        Case 4, 7, 9, 11, 13 ' 29 day months
          nMonthLen = 29
        Case 6 ' Adar A (6) will be skipped on non-leap years
          nMonthLen = 30
        Case 2 ' Cheshvon, see note above
          nMonthLen = IIf(bShalem, 30, 29)
        Case 3 ' Kislev, see note above
          nMonthLen = IIf(bHaser, 29, 30)
      End Select
      If nDays >= nMonthLen Then
 bWhile = True
        If bLeap Or nMonthH <> 5 Then
          nMonthH = nMonthH + 1
        Else

          ' We can skip Adar A (6) if its not a leap year

          nMonthH = nMonthH + 2
        End If
 nDays = nDays - nMonthLen
      Else
 bWhile = False
      End If
    Loop While bWhile

    ' Add the remaining days to Date

    nDateH = nDays + 1
  End If
  GregToHeb = CStr(nMonthH) & "/" & CStr(nDateH) & "/" & CStr(nYearH)
End Function

Public Function FormatDateH(nYearH, nMonthH, nDateH)
  Dim sMonth As String
  Select Case nMonthH
    Case 1
      sMonth = "תשרי"
    Case 2
      sMonth = "חשוון"
    Case 3
      sMonth = "כסלו"
    Case 4
      sMonth = "טבת"
    Case 5
      sMonth = "שבט"
    Case 6
      sMonth = "אדר א'"
    Case 7
      sMonth = IIf(IsLeapYear(nYearH), "אדר ב'", "אדר")
    Case 8
      sMonth = "ניסן"
    Case 9
      sMonth = "אייר"
    Case 10
      sMonth = "סיוון"
    Case 11
      sMonth = "תמוז"
    Case 12
      sMonth = "אב"
    Case 13
      sMonth = "אלול"
  End Select
  FormatDateH = CStr(HebrewNum(nDateH)) _
  & " " & sMonth & " " & CStr(HebrewNum(nYearH))
End Function

Public Function TodayHeb()
  Dim nYearH As Long
  Dim nMonthH As Long
  Dim nDateH As Long
  Dim dToday As Date
 
  dToday = Int(Now())
  GregToHeb dToday, nYearH, nMonthH, nDateH
  TodayHeb = FormatDateH(nYearH, nMonthH, nDateH)
End Function

Public Function DateToHeb(dDate)
  Dim nYearH As Long
  Dim nMonthH As Long
  Dim nDateH As Long
 
  dDate = CDate(dDate)
  GregToHeb dDate, nYearH, nMonthH, nDateH
  DateToHeb = FormatDateH(nYearH, nMonthH, nDateH)
End Function



Function HebrewNum(ByVal n As Integer)
  Dim nX As Integer
  Dim sHundred As String
  Dim sTen As String
  Dim sOne As String
 
  n = n Mod 1000
  nX = n - (n Mod 100)
  Select Case nX
    Case 900
      sHundred = Tuf_() & Tuf_() & Raish_()
    Case 800
      sHundred = Tuf_() & Tuf_() & Kuf_()
    Case 700
      sHundred = Tuf_() & Shin_()
    Case 600
      sHundred = Tuf_() & Raish_()
    Case 500
      sHundred = Tuf_() & Kuf_()
    Case 400
      sHundred = Tuf_()
    Case 300
      sHundred = Shin_()
    Case 200
      sHundred = Raish_()
    Case 100
      sHundred = Kuf_()
  End Select
 n = n - nX
  If n = 15 Then
    sTen = Tes_()
    sOne = Vav_()
  ElseIf n = 16 Then
    sTen = Tes_()
    sOne = Ziyon_()
  Else
    nX = n - (n Mod 10)
    Select Case nX
      Case 90
        sTen = Tzodi_()
      Case 80
        sTen = Pai_()
      Case 70
        sTen = Iyin_()
      Case 60
        sTen = Samech_()
      Case 50
        sTen = Nun_()
      Case 40
        sTen = Mem_()
      Case 30
        sTen = Lamed_()
      Case 20
        sTen = Chaf_()
      Case 10
        sTen = Yud_()
    End Select
 nX = n - nX
    Select Case nX
      Case 9
        sOne = Tes_()
      Case 8
        sOne = Ches_()
      Case 7
        sOne = Ziyon_()
      Case 6
        sOne = Vav_()
      Case 5
        sOne = Hai_()
      Case 4
        sOne = Daled_()
      Case 3
        sOne = Gimmel_()
      Case 2
        sOne = Bais_()
      Case 1
        sOne = Alef_()
    End Select
  End If
 
 HebrewNum = sHundred & sTen & sOne
End Function

Public Function FormatDateHInHeb(nYearH, nMonthH, nDateH)
  Dim sMonth As String
  Select Case nMonthH
    Case 1
      sMonth = Tuf_() & Shin_() & Raish_() & Yud_()
    Case 2
      sMonth = Ches_() & Shin_() & Vav_() & Nun_End_()
    Case 3
      sMonth = Chaf_() & Samech_() & Lamed_() & Yud_() & Vav_()
    Case 4
      sMonth = Tes_() & Bais_() & Tuf_()
    Case 5
      sMonth = Shin_() & Bais_() & Tes_()
    Case 6
      sMonth = Alef_() & Daled_() & Raish_() & ChrW(32) & Alef_()
    Case 7
      sMonth = IIf(IsLeapYear(nYearH), _
                     Alef_() & Daled_() & Raish_() & ChrW(32) & Bais_(), _
                     Alef_() & Daled_() & Raish_())
    Case 8
      sMonth = Nun_() & Yud_() & Samech_() & Nun_End_()
    Case 9
      sMonth = Alef_() & Yud_() & Yud_() & Raish_()
    Case 10
      sMonth = Samech_() & Yud_() & Vav_() & Nun_End_()
    Case 11
      sMonth = Tuf_() & Mem_() & Vav_() & Ziyon_()
    Case 12
      sMonth = Alef_() & Bais_()
    Case 13
      sMonth = Alef_() & Lamed_() & Vav_() & Lamed_()
  End Select
  FormatDateHInHeb = sMonth & " " & HebrewNum(nDateH) & " " & CStr(nYearH)
 
  ' FormatDateHInHeb = sMonth & " " & HebrewNum(nDateH) & " " & HebrewNum(nYearH)
 
 
End Function


Public Function HebDateInHeb(dDate)
  Dim nYearH As Long
  Dim nMonthH As Long
  Dim nDateH As Long
 
  dDate = CDate(dDate)
  GregToHeb dDate, nYearH, nMonthH, nDateH
  HebDateInHeb = FormatDateHInHeb(nYearH, nMonthH, nDateH)
End Function

Function Alef_()
  Alef_ = ChrW(1488)
End Function

Function Bais_()
  Bais_ = ChrW(1489)
End Function

Function Gimmel_()
  Gimmel_ = ChrW(1490)
End Function

Function Daled_()
  Daled_ = ChrW(1491)
End Function

Function Hai_()
  Hai_ = ChrW(1492)
End Function

Function Vav_()
  Vav_ = ChrW(1493)
End Function

Function Ziyon_()
  Ziyon_ = ChrW(1494)
End Function

Function Ches_()
  Ches_ = ChrW(1495)
End Function

Function Tes_()
  Tes_ = ChrW(1496)
End Function

Function Yud_()
  Yud_ = ChrW(1497)
End Function

Function Chaf_End_()
  Chaf_End_ = ChrW(1498)
End Function

Function Chaf_()
  Chaf_ = ChrW(1499)
End Function

Function Lamed_()
  Lamed_ = ChrW(1500)
End Function

Function Mem_End_()
  Mem_End_ = ChrW(1501)
End Function

Function Mem_()
Mem_ = ChrW(1502)
End Function

Function Nun_End_()
   Nun_End_ = ChrW(1503)
End Function

Function Nun_()
  Nun_ = ChrW(1504)
End Function

Function Samech_()
  Samech_ = ChrW(1505)
End Function

Function Iyin_()
  Iyin_ = ChrW(1506)
End Function

Function Pai_End_()
  Pai_End_ = ChrW(1507)
End Function

Function Pai_()
  Pai_ = ChrW(1508)
End Function

Function Tzodi_End_()
  Tzodi_End_ = ChrW(1509)
End Function

Function Tzodi_()
  Tzodi_ = ChrW(1510)
End Function

Function Kuf_()
  Kuf_ = ChrW(1511)
End Function

Function Raish_()
  Raish_ = ChrW(1512)
End Function

Function Shin_()
  Shin_ = ChrW(1513)
End Function

Function Tuf_()
  Tuf_ = ChrW(1514)
End Function

Function UnicodeChar(n As Integer)
  UnicodeChar = ChrW(n)
End Function


 ' Some handy code to help generate code

Public Sub MakeHebrewLet()
  Dim nRow As Integer
 Sheets.Add
  ActiveSheet.Name = "HebrewLet"
  For nRow = 1 To 27
    Cells(nRow, 1) = nRow + 1487
    Cells(nRow, 2) = ChrW(nRow + 1487)
    Select Case nRow
      Case 1
        Cells(nRow, 3) = "Alef"
      Case 2
        Cells(nRow, 3) = "Bais"
      Case 3
        Cells(nRow, 3) = "Gimmel"
      Case 4
        Cells(nRow, 3) = "Daled"
      Case 5
        Cells(nRow, 3) = "Hai"
      Case 6
        Cells(nRow, 3) = "Vav"
      Case 7
        Cells(nRow, 3) = "Ziyon"
      Case 8
        Cells(nRow, 3) = "Ches"
      Case 9
        Cells(nRow, 3) = "Tes"
      Case 10
        Cells(nRow, 3) = "Yud"
      Case 11
        Cells(nRow, 3) = "Chaf_End"
      Case 12
        Cells(nRow, 3) = "Chaf"
      Case 13
        Cells(nRow, 3) = "Lamed"
      Case 14
        Cells(nRow, 3) = "Mem_End"
      Case 15
        Cells(nRow, 3) = "Mem"
      Case 16
        Cells(nRow, 3) = "Nun_End"
      Case 17
        Cells(nRow, 3) = "Nun"
      Case 18
        Cells(nRow, 3) = "Samech"
      Case 19
        Cells(nRow, 3) = "Iyin"
      Case 20
        Cells(nRow, 3) = "Pai_End"
      Case 21
        Cells(nRow, 3) = "Pai"
      Case 22
        Cells(nRow, 3) = "Tzodi_End"
      Case 23
        Cells(nRow, 3) = "Tzodi"
      Case 24
        Cells(nRow, 3) = "Kuf"
      Case 25
        Cells(nRow, 3) = "Raish"
      Case 26
        Cells(nRow, 3) = "Shin"
      Case 27
        Cells(nRow, 3) = "Tuf"
    End Select
  Next
End Sub

Public Function HebSt(S As String)
  Dim n As Integer
 

  For n = 1 To Len(S)
    If n <> 1 Then
      HebSt = HebSt + " & "
    End If
    HebSt = HebSt + HebLetToFunc(Mid(S, n, 1))
  Next
End Function

Function HebLetToFunc(sHebLet As String) As String
  Dim nRow As Integer
  HebLetToFunc = "ChrW(" + CStr(AscW(sHebLet)) & ")"
  nRow = 1
  Do While Sheets("HebrewLet").Cells(nRow, 2) <> ""
    If Sheets("HebrewLet").Cells(nRow, 2) = sHebLet Then
      HebLetToFunc = Sheets("HebrewLet").Cells(nRow, 3) & "_()"
      Exit Do
    End If
    nRow = nRow + 1
  Loop
End Function

אולי מישהו יכו לעזור? ... למה את החודש אני מקבל בסימני שאלה ... מצורף צילום מסך ==>

1640004638482.png
 
  • הוסף לסימניות
  • #16
אולי מישהו יכו לעזור? ... למה את החודש אני מקבל בסימני שאלה ... מצורף צילום מסך ==>

צפה בקובץ המצורף 1027101
כנראה אותה בעיה של קידוד
שים לב שהשנה והתאריך בסדר כי השתמשו בקידוד ע"י פונקציות ולא בטקסט
אולי תייצר פונקציה שתטפל בזה בכל טקסט שאתה מעוניין
 
  • הוסף לסימניות
  • #17
אני צריך מישהו לנסות את התוכנה מעשרות שלי רק כדי לקבל חוות דעת לפני שאני משחרר אותה חינם לאויר ... מישהו רוצה אולי?
 
  • הוסף לסימניות
  • #18
פונקציה קטנה ופשוטה שיכולה לעזור להמרת השנה לתאריך עברי .. אפשר עוד להרחיב את זה למי שרוצה

Public Function ShanaIvrit(ByVal intNum As Integer)

Dim strNum As String = CStr(intNum)
Dim strTemp As String = ""
Dim strTemp1 As String = ""
Dim strTemp2 As String = ""
Dim strTemp3 As String = ""

'לוקח את המאות למשל 5782 נותן את תש
strTemp1 = Mid(strNum, 2, 1)
Select Case strTemp1
Case 7
strTemp1 = "תש"
Case 8
strTemp1 = "תת"
End Select
strTemp = strTemp1

'לוקח את העשרות למשל 5782 נותן את פ
strTemp2 = Mid(strNum, 3, 1)
Select Case strTemp2
Case 1
strTemp2 = "י"
Case 2
strTemp2 = "כ"
Case 3
strTemp2 = "ל"
Case 4
strTemp2 = "מ"
Case 5
strTemp2 = "נ"
Case 6
strTemp2 = "ס"
Case 7
strTemp2 = "ע"
Case 8
strTemp2 = "פ"
Case 9
strTemp2 = "צ"
End Select
strTemp = strTemp1 & strTemp2

'לוקח את האחדות למשל 5782 נותן את ג
strTemp3 = Mid(strNum, 4, 1)
Select Case strTemp3
Case 1
strTemp3 = "א"
Case 2
strTemp3 = "ב"
Case 3
strTemp3 = "ג"
Case 4
strTemp3 = "ד"
Case 5
strTemp3 = "ה"
Case 6
strTemp3 = "ו"
Case 7
strTemp3 = "ז"
Case 8
strTemp3 = "ח"
Case 9
strTemp3 = "ט"
End Select
strTemp = strTemp1 & strTemp2 & ChrW(34) & strTemp3

ShanaIvrit = strTemp

End Function
 
  • הוסף לסימניות
  • #19
אני מחפש עzרה מי שיכול לכתוב לי לפי הקוד שם רחמיםR (שרשור 2) איך אני כותב את הפונקציה בכדי להפוך תאריך עברי ללועזי
השאלה כוללת 2 דברים:
1. באיזה תבנית אני צריך לרשום את התאריך העברי עם גרשיים / ללא וכדו'
2. מה אני כותב בכדי שהפונקציה ימיר את התאריך ללועזי.
מצורף דוגמא:
()Private Sub DateHebrew_AfterUpdate​
Me.DateEnglish = ????????????? (Me.DateHebrew)​
Me.DateEnglish.Requery
End Sub​
בתודה מראש
 

פרוגבוט

תוכן שיווקי
פרסומת

פוסטים חדשים שאולי לא קראת....

הכותרת לא באה להתריס היא באה להדגיש מצב
ולא לא באתי לומר שאבא או אמא עם ילד או שניים זה לא אתגר
אבל שימו לב
בעוד אתם בונים על ההורים לרוב פסח ולכן מכשירים פיסת שיש קטן לפינת קפה. מדף במקרר. ובארון
כי מילא רוב החג נהייה אצל ההורים
ההורים והרווקים בבית קורעים את עצמם [תזכרו זה לא היה כזה מזמן]
כן אמא שלך לא נחה כבר 3 שבועות

להפוך בית שלם 100+ מטר של ארונות כיורים שולחנות מטבח סלון כיסאות מזווה מיטות
לכשר לפסח
לאפשרות שאתם וילדכם הסתובבו בחופשיות עם מצה ואפיקומן שסבא קנה
לא נכנסתי להוצאות המטורפות שקצת עוברות לידכם. למה שתקנו מצות יין או חסה או נייר כסף לציפוי המטבח
ושוב לא בהאשמה ולא בטרוניה אלא כנתון מציאותי
אז זו''צ יקר קצת שימת לב
לפרגן לבוא לעזור חצי יום
לפרגן ארוחה לעובדים בבית [הבית שלך חמץ המטבח שלהם במרפסת שרות]
לתת מילה טובה או שוקולד
והחשוב מכל
מעשרות להורים
הם חשובים יותר מכל כולל ארגון או קמחה דפסחא הם ההורים שלך

והם יממנו לך את ארוחות וסעודות החג
בס"ד

ההבדל בין נוכלות לבין כישלון



לפני כחודש נערך בבני ברק מיפגש מאוד מעניין של גוף הנקרא "הפורום להגנת הצרכן" והוא עסק בעיקר בדרכים למניעת נפילות נדל"ן בהם הציבור החרדי "מומחה" ליפול חזור ונפול.

הנוכחים, מומחים איש איש בתחומו, תיארו את הנוכלויות הרווחות היום ותיארו בצבעים קודרים ואמיתיים את המצב בכי רע, היו שם גדולי הדיינים שדיברו על הצורך להבטיח שהדור השני לא עושה שטויות עם הדירה שקיבלו מההורים וכן הלאה.

כאשר ר' איצ'ה דזיאלובסקי העניק לי את רשות המילה האחרונה (בגלל שאיחרתי – הרגל נעשה טבע) בקשתי מהנוכחים שלא יישפכו את התינוק אם המים, כלומר שלא יביאו אנשים למצב שבו הם חושדים בכל מה שלא זז שהוא נוכלות, הדבר הזה טענתי עלול להביא לשיתוק מוחלט של שוק השקעות הנדל"ן החרדי אשר היה והינו הקטליזטור הראשי של הציבור החרדי בדרכו לנישואי ילדים ברוגע ושלווה, המסר המרכזי של שתי דקות הנאום שלי זה מה שאתם הולכים לקרוא באלף מילים הבאות: לא כל עסקה כושלת היא אשמת המשווק!

צרות אחרונות משכחות את הראשונות וכך שכחתי מזה לגמרי, אלא שהשבוע פורסמה כתבה בעיתון 'דה-מרקר' (מי שלא מכיר לא הפסיד - מלא באהבת כסף ושנאת חרדים) כתבת תחקיר עומק אודות תופעת העוקצים בציבור החרדי הכרוכים במבצעי 10/90 הזכורים לשימצה.

מה שלא אהבתי זה ההתמקדות במתווך חרדי מסוים כאילו הוא שורש הרע בעולם כולו ואיך מלאו ליבו כביכול, ומעשה שהיה כך הווה בעשרות עותקים ברחבי הארץ שרובם מוכרים לי היטיב:

אברכים שחושבים שהם אנשי-עסקים פותו בידי אנשי-עסקים שחושבים שהם אברכים לקנות דירות פאר בערים שהם מכירים רק מחלונות האוטובוס בדרך למירון, נתניה ובת ים מככבות בכתבה אך זה לאורך כל הארץ בערים אשר אברך ממוצע מכיר את שמותיהם רק מהתרעות פיקוד העורף (או מהנפילות שאחריהן) ומעולם לא ביקר בהן.

אז איך משכנעים אברך כולל חסידי בן 22 שקיבל מההורים חצי מיליון ₪ לצורך יחידת 'סליחה' בביתר, לרכוש פנטהוז בהרצליה בארבע מיליון ₪ ?

מספרים לו שזה מבצע מיוחד שהתגלה רק למתווך בגילוי שמימי וכעת צריך רק לשלם עשרה אחוז שזה ארבע מאות אלף שקל ואת המאה הנותרים להביא למתווך על הגילוי הנפלא.

ואיך הדלפון שלנו יממן את מה שעשירי טבריה מתקשים?

כאן מגיע החלק השני של הגילוי אליהו – המתווך יודע לנבא כי בעוד שלוש שנים, כשיצטרכו להשלים את הרכישה הדירה תהיה שווה חמישה מיליון, ואז האברך דנן יתברר כסוחר מוצלח ביותר אשר ימשוך חזרה את הארבע מאות ועוד מיליון רווח נקי וכך לא יצטרך לגור בדירת הסליחה אלא בדירה גדולה המרחיבה דעתו של אדם ומרחיבה ארנקו של המשווק.

אז איפה הקצ'?

שעכשיו זה "אחרי שלוש שנים" ומתברר כי המחיר הכי גבוה שאפשר לקבל על הדירה הוא שלוש וחצי מיליון ואחרי ההוצאות מגיעים לשלוש מאתיים נטו ביד, מה שאומר שלפעמים עדיף לאותו אברך לעשות "ויברח" ולהותיר את הארבע מאות אצל החברה והמשווק ולחזור ליחידת הסליחה אבל וחפוי ראש, והפעם כשוכר...

זה פחות או יותר המסלול שאותו עוברות בחודשים אלו מאות משפחות מאנ"ש שכל מה שהם רצו זה לחתן את הילדים בכבוד וכעת הם מרוסקים לחלוטין וייקח להם שנים רבות אם בכלל כדי להתאושש מהתהום הכלכלית שהם הוכנסו אליה בידי משווק פלוני.

אך עשרת הקוראים כאן יודעים שעד כאן הייתה רק ההקדמה, כעת נתחיל עם הניתוח הכואב של הנתונים ואת הצד של לימוד זכות:

ובכן, קודם כל צריך לדעת שרבים מאוד הרוויחו בפריסיילים ותכניות דומות הרבה כסף, פגשתי ועודני פוגש כל יום אברכים צעירים ומבוגרים שהרוויחו סכומים אגדיים בשנים האחרונות כתוצאה מהפטנט הזה, לא ערכתי מחקר עומק אך מהתרשמותי המרוויחים רבים בהרבה על המפסידים וחבל שאת זה שומרים בסוד מאימת המצ'ינגים, הסיבה היחידה שמספרים לי על כך זה או כדי לשאול איך לעשות את הסיבוב הבא או כדי להתייעץ איך לצמצם את המסים העצומים (ברוך השם, כשיש מס סימן שיש שבח).

כל מי שקנה דירה בירושלים במחירי פריסייל של עשרים ומשהו אלף עשה את המיליון הזה, כך גם רבים שהשקיעו בחלק מהפרוייקטים בבן שמן וכך גם במקומות נוספים אשר המחירים עלו שם דרמטית ולקחו איתם את המשקיעים כלפי מעלה.

אז מה קרה בכל הפרוייקטים הכושלים?

שני דברים, הראשון שלא ידוע לי אם קרה זה הקפצת מחירים, מאוד ייתכן שמשווק מסוים יבוא לקבלן שיש לו כבר פריסייל ויגיד לו במקום למכור ב3.9 אביא לך קונים בארבע מיליון ואז מקבלים תרי זוזי: מאה אלף מהקבלן ועוד אחד מהלקוח, חד גדיא דזבין את אבא.

זה נורא לשמוע שיש דברים כאלו וטיפש מי שנופל לכך אך מי שיותר טיפש ממנו הוא מי שמאמין שאפשר למנוע דבר כזה באמצעות בירור אם המתווך אמין: גם המתווך האמין ביותר לא יעמוד בפני ניסיון של מאתיים אלף ₪ רק מלאך יוותר על זה ולא ניתנה תורת העסקים למלאכי השרת.

אך הדבר הזה לא מתקיים בדרך כלל משום שרוב הקונים יודעים לבדוק בערך את המחיר בסביבה ולא נופלים לבורות עמוקים, מה שכן קורה זה הדבר השני ועליו ברצוננו לדבר:

המחיר פשוט לא עלה, ולפעמים אפילו ירד.

כן רבייסיי, מחירי דירות לא רק עולים, לפעמים הם גם יורדים, כגון למשל בתקופת מלחמה.

עד מלחמת שמחת-נורא המחירים בנתניה למשל אכן השתוללו כי הצרפתים קנו שם בהמוניהם והוא הדין בצפת שהאמריקאים עטו עליה כי אצלם אין הבדל בין ירושלים לצפת, באמריקה זה מרחק סביר לנסיעה יומיומית לעבודה, אז מישהו משווק להם את זה כירושלים לעניים והם קנו וקנו והמחירים עלו ועלו והייתה היתכנות מסויימת לעלייה צפוייה.

ואז הגיע המלחמה ואין חוצניקים, ועוד מלחמה ועוד מבצע ושום דבר לא חזר לעצמו ואפשר לקלל את איראן (מגיע להם) ואת החמאס (עוד יותר מגיע) אך זה לא יעזור לעובדה הפשוטה שמחירי המגדלים שיועדו בעיקר לאוכלוסיות אלו צולל.

לא בהרבה, אך מספיקה ירידה של 8% כדי שכל העסק יהפוך להפסד.

זה נכון שמעצבן שהמשווק ניבא שהמחירים יעלו והם לא, אמנם אמרו חז"ל שנבואה ניתנה לשוטים אך האמונה כי יש למישהו נבואה ניתנה לשוטים גדולים עוד יותר... כל בר דעת העושה עסקים יודע שבכל הקשור לניבוי עתידות - המשווק ועטיפת המסטיק יודעים לנבא באותה מידה ומי שמסתמך על הבטחות אודות העתיד (כולל אלפי אברכים שנופלים היום בפריסייל של המחר שנקרא פינוי בינוי המבוסס על אותה נבואה כמעט) אין לו לבוא בטענות אלא על עצמו, לא המשווק נשך לשונרא.

מקווה שהצלחתי להסביר: לא כל עסקה כושלת היא נוכלות ולא כל ירידת מחירים היא עקיצה, בכל עסק ייתכן מאוד הפסד ומי שלא מוכן לכך שלא ייכנס לעולם ההשקעות.

אז להפסיק להשקיע בנדל"ן?

חלילה, כמה שיותר להשקיע בנדל"ן וכל המרבה הרי זה משובח – ואם ירצה השם ויהיה זמן נרחיב אולי בטור הבא על "מה כן" – אך רק עסקאות נטולות הימור על כל הקופה, כך שגם אם נגזר עליך להפסיד זה יהיה רק קצת ורק זמני.

ברור לי שכל הדברים האמורים כאן ברורים לכל אחד מעשרת הקוראים וסליחה שבזבזתי את זמנכם אך אם זה ירגיע אבא סוער אחד -שכועס בכל ליבו על המתווך שכאילו הפיל את החתן שלו - והיה זה שכרי.



גילוי נאות: לכותב אין ולא היה שום אינטרס כלכלי בשום פרוייקט של פריסל והוא אינו קשור היום לשום שיווק לא במישרין ולא בעקיפין, המידע מובא ללא כל אינטרס כלכלי אלא כצדקה ושירות לציבור, לשאלות ספציפיות ניתן לפנות למייל והתשובות שם חינם וללא אחריות.
סיכום אירועים: איראן בלהבות - מהמחאות ועד לסף עימות עולמי

הרקע וההתפרצות (סוף דצמבר 2025):

המחאות החלו ב-28 בדצמבר 2025 בטהראן, על רקע משבר כלכלי חריף וצניחה חדה בערך הריאל. מה שהחל כזעקת סוחרים ואזרחים על יוקר המחיה, הפך במהירות לגל הפגנות חסר תקדים ב-187 ערים הקורא להפלת המשטר.


הטבח והחשכת המידע (ינואר 2026):
  • דיכוי אלים: המשטר האיראני הגיב באכזריות יוצאת דופן. לפי נתוני ארגון זכויות האדם HRANA, נכון ל-23 בינואר, מספר ההרוגים המאומת עומד על למעלה מ-5,000 בני אדם, בהם 4,716 מפגינים ועשרות ילדים.
    יש דיווחים לא מאומתים מצד האופוזיציה האיראנית על מעל 60,000 הרוגים!

  • מעצרים המוניים: למעלה מ-26,500 בני אדם נעצרו, וקיים חשש כבד להוצאות להורג המוניות בבתי הכלא.

  • חסימת אינטרנט: החל מה-8 בינואר הוטל מצור דיגיטלי כמעט מוחלט על המדינה כדי למנוע זליגת תיעודים מהטבח.

המעורבות האמריקנית - "הארמדה של טראמפ":
הנשיא טראמפ, שחזר והזהיר את טהראן מפני המשך הטבח, הכריז ב-22 בינואר כי "ארמדה" אמריקנית (צי ספינות מלחמה, כולל נושאת המטוסים אברהם לינקולן) עושה את דרכה למפרץ הפרסי. טראמפ הבהיר כי ארה"ב בוחנת אפשרויות תקיפה ישירות נגד מטרות שלטוניות אם לא ייפסק הדיכוי. ולאחר הדלפות על ממדי הטבח, הכריז "העזרה בדרך".


הזווית הישראלית והאזורית:
  • כוננות שיא: ישראל נמצאת בדריכות עליונה מחשש שהסלמה אמריקנית תוביל לתגובה איראנית ישירה או באמצעות שלוחיה (פרוקסי).

  • איומי נתניהו: ראש הממשלה נתניהו הזהיר כי אם איראן תבצע "טעות" ותתקוף את ישראל, היא תפגוש עוצמה שטרם הכירה.

  • איומי טהראן: המשטר האיראני הודיע כי במקרה של תקיפה, בסיסים אמריקניים ויעדים בישראל יהיו "מטרות לגיטימיות".

באשכול זה נמשיך לעדכן סביב השעון בכל התפתחות, דיווחים מהשטח ופרשנויות ביטחוניות.
עודכן אדר תשפ"ד
ראשית, גופי הכשרות
ברוב אשכולות בנושא 'השקעות בשוק ההון' בפרוג, משתרבב עניין הכשרות.
למען הסדר באשכול זה נעלה עדכונים בנושא כשרות.
אני אשתדל לסכם ולתמצת ככל האפשר.

יש 4 גופי כשרות
  • בד"ץ העדה החרדית - על פי פסקי הרב יעקב בלוי זצ"ל שהיה בקיא גדול בתחום שוק ההון והוא שהביא את פסקיו ועל פי פסקים אלו נוהגים עד היום בגוף כשרות זה. היום הכשרות בראשות הרב שלמה זאב קרליבך.
  • גלאט הון - על פי פסקי רבי ניסים קרליץ והרב שמואל ואזנר. שסמכו ידיהם על הרב יעקב לנדו שמכיר את שוק ההון לעומקו. הרב משה שטרנבוך ראב"ד העדה החרדית הוא מרבני 'גלאט הון'.
  • תשואה כהלכה – הרב שמואל דוד גרוס, רב חסידי גור אשדוד ועוד רבנים מוכרים וידועים בכל שכבות הציבור החרדי.
  • כלכלה על פי ההלכה- הרב אריה דביר, על פי פסקי הרב יוסף שלום אלישיב.

היום בכל החברות יש מסלולים כשרים, שמאושרים לפחות ע"י אחת מהכשרויות.
בין החברות שנמצאת ברשותם תעודת כשרות אפשר למצוא את:
אלטשולר שחם, אינפיניטי, הפניקס, הראל, כלל, מגדל, מור, מיטב דש, מנורה.

רשימות קרנות כשרות:

הצטרפות לניוזלטר

איזה כיף שהצטרפתם לניוזלטר שלנו!

מעכשיו, תהיו הראשונים לקבל את כל העדכונים, החדשות, ההפתעות בלעדיות, והתכנים הכי חמים שלנו בפרוג!

לוח מודעות

הפרק היומי

הפרק היומי! כל ערב פרק תהילים חדש. הצטרפו אלינו לקריאת תהילים משותפת!


תהילים פרק כה

אלְדָוִד אֵלֶיךָ יי נַפְשִׁי אֶשָּׂא:באֱלֹהַי בְּךָ בָטַחְתִּי אַל אֵבוֹשָׁה אַל יַעַלְצוּ אֹיְבַי לִי:גגַּם כָּל קוֶֹיךָ לֹא יֵבֹשׁוּ יֵבֹשׁוּ הַבּוֹגְדִים רֵיקָם:דדְּרָכֶיךָ יי הוֹדִיעֵנִי אֹרְחוֹתֶיךָ לַמְּדֵנִי:ההַדְרִיכֵנִי בַאֲמִתֶּךָ וְלַמְּדֵנִי כִּי אַתָּה אֱלֹהֵי יִשְׁעִי אוֹתְךָ קִוִּיתִי כָּל הַיּוֹם:וזְכֹר רַחֲמֶיךָ יי וַחֲסָדֶיךָ כִּי מֵעוֹלָם הֵמָּה:זחַטֹּאות נְעוּרַי וּפְשָׁעַי אַל תִּזְכֹּר כְּחַסְדְּךָ זְכָר לִי אַתָּה לְמַעַן טוּבְךָ יי:חטוֹב וְיָשָׁר יי עַל כֵּן יוֹרֶה חַטָּאִים בַּדָּרֶךְ:טיַדְרֵךְ עֲנָוִים בַּמִּשְׁפָּט וִילַמֵּד עֲנָוִים דַּרְכּוֹ:יכָּל אָרְחוֹת יי חֶסֶד וֶאֱמֶת לְנֹצְרֵי בְרִיתוֹ וְעֵדֹתָיו:יאלְמַעַן שִׁמְךָ יי וְסָלַחְתָּ לַעֲוֹנִי כִּי רַב הוּא:יבמִי זֶה הָאִישׁ יְרֵא יי יוֹרֶנּוּ בְּדֶרֶךְ יִבְחָר:יגנַפְשׁוֹ בְּטוֹב תָּלִין וְזַרְעוֹ יִירַשׁ אָרֶץ:ידסוֹד יי לִירֵאָיו וּבְרִיתוֹ לְהוֹדִיעָם:טועֵינַי תָּמִיד אֶל יי כִּי הוּא יוֹצִיא מֵרֶשֶׁת רַגְלָי:טזפְּנֵה אֵלַי וְחָנֵּנִי כִּי יָחִיד וְעָנִי אָנִי:יזצָרוֹת לְבָבִי הִרְחִיבוּ מִמְּצוּקוֹתַי הוֹצִיאֵנִי:יחרְאֵה עָנְיִי וַעֲמָלִי וְשָׂא לְכָל חַטֹּאותָי:יטרְאֵה אוֹיְבַי כִּי רָבּוּ וְשִׂנְאַת חָמָס שְׂנֵאוּנִי:כשָׁמְרָה נַפְשִׁי וְהַצִּילֵנִי אַל אֵבוֹשׁ כִּי חָסִיתִי בָךְ:כאתֹּם וָיֹשֶׁר יִצְּרוּנִי כִּי קִוִּיתִיךָ:כבפְּדֵה אֱלֹהִים אֶת יִשְׂרָאֵל מִכֹּל צָרוֹתָיו:
נקרא  2  פעמים
למעלה