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

كود تنسيق ليست بوكس


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

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

السادة الأفاضل

يوجد لدي عمود للوقت في الشيت تنسيقه "hh:mm AM/PM"

وعندما يظهر في الليست بوكس لا يظهر بنفس التنسيق ولكن يظهر رقم عشري

اريد أن يظهر في الليست بوكس كما في الشيت

ولكم جزيل الشكر

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

الأستاذ أبو أحمد

جزاك الله خيرا علي الرد

وأعتذر منك علي التأخير

واليكم المرفقات

عمود وقت الإدخال في الشيت يظهر في الليست بوكس رقم عشري ولا يظهر تنسيق وقت

وأريد أن يظهر بنفس التنسيق الموجود في الشيت

ووفقكم الله لكل الخير

وللعلم المرفق مقتبس من العلامة الكبير عبدالله باقشير.

تنسيق الليست بوكس.rar

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

السلام عليكم

اضغط مرتين على زر البحث الموجود في الفورم ستجد كود

قم بحذفه و استبدله بالكود التالي :


Private Sub ButtonFind_Click()

Dim MyValue

Dim MyAr() As String

Dim ib As Boolean

Dim R As Integer, i As Integer, ii As Integer

Dim MyColmnFind As Integer, LastRow As Integer

Dim dt1 As Date, dt2 As Date

MyColmnFind = Me.ComboFind.ListIndex + 1

If MyColmnFind = 0 Then Exit Sub

If MyColmnFind = 3 Then Me.TextFind = ""

Me.ListFind.Clear

With sRng.Worksheet

LastRow = .Range("A65536").End(xlUp).Row

If IsDate(Me.TextDate1) Then dt1 = DateValue(Me.TextDate1) Else dt1 = WorksheetFunction.Min(.Range("C2").Resize(LastRow)): Me.TextDate1 = Format(dt1, DateFormt)

If IsDate(Me.TextDate2) Then dt2 = DateValue(Me.TextDate2) Else dt2 = WorksheetFunction.Max(.Range("C2").Resize(LastRow)): Me.TextDate2 = Format(dt2, DateFormt)

End With

sColmn = ""

With sRng

For R = 2 To LastRow

	 Select Case .Cells(R, 3).Value2: Case dt1 To dt2

		 ib = InStr(1, .Cells(R, MyColmnFind), Me.TextFind, vbTextCompare) = 1

		 If ib Then

			 sColmn = sColmn & R & " "

			 ii = ii + 1

			 ReDim Preserve MyAr(1 To ContColmn, 1 To ii)

			 For i = 1 To ContColmn

				 If IsDate(.Cells(R, i)) Then MyValue = Format(.Cells(R, i).Value2, DateFormt) _

				 Else: MyValue = .Cells(R, i).Value2

				 MyAr(i, ii) = MyValue

			 Next

		 End If

	 End Select

Next

End With

If ii Then Me.ListFind.Column = MyAr: Me.ListFind.ListIndex = 0

For s = 0 To ListFind.ListCount

ListFind.ListIndex = s - 1

If s Then

ListFind.Column(3) = Format(ListFind.Column(3), "hh:mm AM/PM")

End If

Next

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