اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

انشاء رقم مرجعي من عدة بيانات


amenbkr
إذهب إلى أفضل إجابة Solved by حسين مامون,

الردود الموصى بها

السلام عليكم

لدي الجدول للموظفين فيه رقم الموظف وفي الاعلى الشهر والسنة واريد ان اضع الى جانب كل اسم موظف رقم مرجعي يكون مجمع رقم الموظف ثم الشهر والسنة ثم حرفين

مثال "21000710820PS"   حيث رقم 2100071 هو رقم الموظف ثم الشهر 08 ثم السنة 20 ثم حرفين PS  ارجو المساعدة ولكم جزيل الشكر

01.xlsx

رابط هذا التعليق
شارك

  • أفضل إجابة
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim lr, x
lr = Cells(Rows.Count, 1).End(3).Row
If Not Intersect(Target, Range("a4:a" & lr)) Is Nothing Then
For x = 4 To lr
Cells(x, "d") = Cells(x, "a") & Format(Range("c2"), "mmyyyy") & "PS"
Next x
End If
End Sub

01.xlsm

  • Thanks 1
رابط هذا التعليق
شارك

استاذ محسن

مرة ثانية و بدون حلقات تكرارية

Option Explicit
Dim lr
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
lr = Cells(Rows.Count, 1).End(3).Row
If lr < 4 Then GoTo exit_Me
    If Target.Address(0, 0) = "C2" And _
      IsDate(Target) And Target.Count = 1 Then
      Cells(4, 4).Resize(lr - 3).ClearContents
       With Cells(4, 4).Resize(lr - 3)
         .Formula = "=A4&TEXT($C$2,""DMMYYYy"")&""PS"""
         .Value = .Value
       End With
     End If
exit_Me:
 Application.EnableEvents = True
End Sub

 

 

amenbkr.xlsm

  • Like 1
  • Thanks 1
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information