اذهب الي المحتوي
أوفيسنا

ترحيل بشروط


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

السلام عليكم ورحمة الله وبركاته 

تحياتي الى جميع الاساتذة والاعضاء الكرام

ترحيل بشروط معينة وموضحة بالمرفق 

 

 

TEXT.rar

 

تم تعديل بواسطه الذيب 2015
رابط هذا التعليق
شارك

جرب الكود التالي

Public Sub A_Add()
Dim Sh As Worksheet, Sht As Worksheet
Set Sht = Sheets("Sheet2")
Set Sh = Sheets("Sheet1")
i = 1
Lr = Sh.Cells(Rows.Count, 1).End(xlUp).Row
For Each R In Sh.Range("A1:J" & Lr).Rows
   A = Join(Application.Index(R.Value, 0), ",")
   B = Replace(A, "ES", "MR")
   B = Mid(B, 1, InStr(1, B, Split(B, ",")(3)) - 1) & Adm("0.00,", 3) & Split(B, ",")(7) & "." & String(2, "0") & Adm(",0.00", 2)
   A = A & String(3, "0")
   ii = Sht.Cells(Rows.Count, 1).End(xlUp).Row + 1
   Sht.Cells(ii, 1) = Choose(1, A, B)
   Sht.Cells(ii + 1, 1) = Choose(2, A, B)
   i = i + 1: ii = ii + 1
Next
End Sub
Private Function Adm(Strn$, Ln&)
    Adm = Application.Rept(Strn, Ln)
End Function

 

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

 

تفضل

Public Sub A_Add()
Dim Sh As Worksheet, Sht As Worksheet
Dim R As Range
Set Sht = Sheets("Sheet2")
Set Sh = Sheets("Sheet1")
i = 1
Lr = Sh.Cells(Rows.Count, 1).End(xlUp).Row
For Each R In Sh.Range("A1:J" & Lr).Rows
   A = Join(Application.Index(R.Value, 0), ",")
   A = Formt(A, Split(A, ",")(4)): A = Formt(A, Split(A, ",")(5))
   B = Replace(A, "ES", "MR")
   B = Mid(B, 1, InStr(1, B, Split(B, ",")(3)) - 1) & Adm("0.00,", 3) & Split(B, ",")(7) & "." & String(2, "0") & Adm(",0.00", 2)
   A = A & String(3, "0")
   ii = Sht.Cells(Rows.Count, 1).End(xlUp).Row + 1
   Sht.Cells(ii, 1) = Choose(1, A, B)
   Sht.Cells(ii + 1, 1) = Choose(2, A, B)
   i = i + 1: ii = ii + 1
Next
End Sub
Private Function Formt(R, Nm)
    Formt = Replace(R, Nm, Format(Nm, "yyyy-mm-dd"))
End Function
Private Function Adm(Strn$, Ln&)
    Adm = Application.Rept(Strn, Ln)
End Function

 

تم تعديل بواسطه الـعيدروس
  • Like 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