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

طلب كود للفرز


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

ماذا تقصد فرز طبقا لتاريخ او وظيفة ؟

الفرز تصاعدي او تنازلي فقط ؟

اذا كنت تقصد تصفيه حسب شرط او شرطين معاً لابأس

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

هذا الكود في حدث الورقة

قبل تنفيذ الكود الغي جميع الخلايا المدموجه

اضفت سطر في الكود لإلغاء الخلايا المدموجة

للفرز لأي عمود انقر مرتين في عنوان العمود السطر الخامس


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If Not Intersect(Target, [B4:AH4]) Is Nothing Then

With ActiveSheet

Cells.UnMerge

Dim Rw$

E = Cells(Rows.Count, 3).End(xlUp).Row

Rw = "5:" & E

.Rows(Rw).Sort Key1:=.Cells(5, 2), Order1:=xlAscending, Header:=xlNo

.Cells(5, 2).HorizontalAlignment = xlRight

	 Cancel = True

' .Rows(Rw).Sort Key1:=.Cells(5, 2), Order1:=xlDescending, Header:=xlNo

' .Cells(5, 2).HorizontalAlignment = xlRight

'	 Cancel = True

End With

End If

End Sub

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

السموحه على هذا الخطاء

تفضل


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

If Not Intersect(Target, [B4:AH4]) Is Nothing Then

With ActiveSheet

Cells.UnMerge

Dim Rw$

E = Cells(Rows.Count, 3).End(xlUp).Row

Rw = "5:" & E

.Rows(Rw).Sort Key1:=.Cells(5, Target.Column), Order1:=xlAscending, Header:=xlNo

.Cells(5, Target.Column).HorizontalAlignment = xlRight

Cancel = True

' .Rows(Rw).Sort Key1:=.Cells(5, Target.Column), Order1:=xlDescending, Header:=xlNo

' .Cells(5, Target.Column).HorizontalAlignment = xlRight

'  Cancel = True

End With

End If

End Sub

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

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