وعليكم السلام ورحمة الله وبركاته
هذا الكود الاول
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.CountLarge > 1 Then Exit Sub
If Target.Row > 91 Then
If Target.Column = 35 Then
Sheets("ELS").Cells(Target.Row - 86, "P").Value = Sheets("ELS").Cells(Target.Row - 86, "N").Value
Sheets("ELS").Cells(Target.Row - 86, "N").Value = Sheets("ELS").Cells(Target.Row - 86, "L").Value
Sheets("ELS").Cells(Target.Row - 86, "L").Value = Sheets("ELS").Cells(Target.Row - 86, "J").Value
Sheets("ELS").Cells(Target.Row - 86, "J").Value = Sheets("ELS").Cells(Target.Row - 86, "H").Value
Sheets("ELS").Cells(Target.Row - 86, "H").Value = Target.Value
End If
If Target.Column = 36 Then
Sheets("ELS").Cells(Target.Row - 86, "Q").Value = Sheets("ELS").Cells(Target.Row - 86, "O").Value
Sheets("ELS").Cells(Target.Row - 86, "O").Value = Sheets("ELS").Cells(Target.Row - 86, "M").Value
Sheets("ELS").Cells(Target.Row - 86, "M").Value = Sheets("ELS").Cells(Target.Row - 86, "K").Value
Sheets("ELS").Cells(Target.Row - 86, "K").Value = Sheets("ELS").Cells(Target.Row - 86, "I").Value
Sheets("ELS").Cells(Target.Row - 86, "I").Value = Target.Value
End If
End If
End Sub
وهذا الكود الثاني
Function ContDate(MyDate1 As Date, MyDate2 As Date, YMD As String)
D1 = Day(MyDate1): D2 = Day(MyDate2)
M1 = Month(MyDate1): M2 = Month(MyDate2)
Y1 = Year(MyDate1): Y2 = Year(MyDate2)
If D1 > D2 Then Dr = D2 + 30 - D1: M = -1 Else Dr = D2 - D1
If M1 > M2 Then Mr = M2 + M + 12 - M1: Y = -1 Else Mr = M2 - M1
Yr = Y2 - Y1 + Y
If YMD = "D" Or YMD = "d" Then ContDate = Dr
If YMD = "M" Or YMD = "m" Then ContDate = Mr
If YMD = "Y" Or YMD = "y" Then ContDate = Yr
End Function
وهذي المعادلات
IFERROR(MID(YEAR
IF(ISERR
IFERROR(VLOOKUP
وغيرها من المعادلات
جميعها في قاعدة بيانات واحدة
وجميعها اخذتها من أسئلتي في هذا الصرح الشامخ
وبمعونة الله ثم الاساتذة الكرام بهذا المنتدى المميز