24-11-21, 03:55 AM
تلوين البينات المكرره في العمود الرابع بالون الاحمر والغير مكرره باللون الاخضر
تلوين اعلى قيمةاو اقل قيمة بالون الاصفرفي العمود الثالث
تلوين اعلى قيمةاو اقل قيمة بالون الاصفرفي العمود الثالث
If Trim(.Text) = "repeater" Then
.CellBackColor = vbRed
ElseIf Trim(.Text) = "non repeater" Then
.CellBackColor = vbGreen
End IfIf Trim(.Text) = "repeater" Then
.Col = .Col - 1
.CellBackColor = vbRed
ElseIf Trim(.Text) = "non repeater" Then
.Col = .Col - 1
.CellBackColor = vbGreen
End If(25-11-21, 12:21 AM)Taha Okla كتب : [ -> ]لتلوين الارقام استبدل الكود التالي في مشروع م/احمد عبد العليم :
كود :
If Trim(.Text) = "repeater" Then
.CellBackColor = vbRed
ElseIf Trim(.Text) = "non repeater" Then
.CellBackColor = vbGreen
End If
ليس لدى non repeater هذة للمثال
بالكود :
كود :
If Trim(.Text) = "repeater" Then
.Col = .Col - 1
.CellBackColor = vbRed
ElseIf Trim(.Text) = "non repeater" Then
.Col = .Col - 1
.CellBackColor = vbGreen
End If
Public Sub Loadx()
Dim I, XCol As Integer
Dim txt As String
Dim vMe
Dim vMin
Dim vMax
If rs.State = adStateOpen Then rs.Close
rs.Open "select * from T_DATE", Con, adOpenStatic, adLockPessimistic
Set mshflexgrid1.DataSource = rs
With Me.mshflexgrid1
vMin = Val(.TextMatrix(1, 3))
vMax = Val(.TextMatrix(1, 3))
For XCol = 3 To .Cols - 1
For I = 1 To .Rows - 1
.Row = I
.Col = .Cols - 1
If Trim(.Text) = "repeater" Then
.Row = I
.Col = XCol
.CellBackColor = vbRed
ElseIf Trim(.Text) = "non repeater" Then
.Row = I
.Col = XCol
.CellBackColor = vbGreen
End If
vMe = Val(.TextMatrix(I, 3))
If vMe < vMin Then
vMin = vMe
End If
If vMe > vMax Then
vMax = vMe
End If
Next I
Next XCol
For I = 1 To .Rows - 1
.Row = I
.Col = 3
If Val(.TextMatrix(I, 3)) = vMin Then
.CellBackColor = vbYellow
End If
If Val(.TextMatrix(I, 3)) = vMax Then
.CellBackColor = vbYellow
End If
Next
End With
End Sub
(25-11-21, 11:25 AM)ahmedabdelaliem كتب : [ -> ]السلام عليكم
بارك الله فيك اخي طه وزادك من علمه وفضله
اخي Mhqom
استبدل الكود بهذا الكود
بالتوفيقPHP كود :
Public Sub Loadx()
Dim I, XCol As Integer
Dim txt As String
Dim vMe
Dim vMin
Dim vMax
If rs.State = adStateOpen Then rs.Close
rs.Open "select * from T_DATE", Con, adOpenStatic, adLockPessimistic
Set mshflexgrid1.DataSource = rs
With Me.mshflexgrid1
vMin = Val(.TextMatrix(1, 3))
vMax = Val(.TextMatrix(1, 3))
For XCol = 3 To .Cols - 1
For I = 1 To .Rows - 1
.Row = I
.Col = .Cols - 1
If Trim(.Text) = "repeater" Then
.Row = I
.Col = XCol
.CellBackColor = vbRed
ElseIf Trim(.Text) = "non repeater" Then
.Row = I
.Col = XCol
.CellBackColor = vbGreen
End If
vMe = Val(.TextMatrix(I, 3))
If vMe < vMin Then
vMin = vMe
End If
If vMe > vMax Then
vMax = vMe
End If
Next I
Next XCol
For I = 1 To .Rows - 1
.Row = I
.Col = 3
If Val(.TextMatrix(I, 3)) = vMin Then
.CellBackColor = vbYellow
End If
If Val(.TextMatrix(I, 3)) = vMax Then
.CellBackColor = vbYellow
End If
Next
End With
End Sub
Public Sub Loadx()
Dim Rs2 As New ADODB.Recordset
Dim I, XCol As Integer
Dim txt As String
Dim vMe
Dim vMin
Dim vMax
If Rs.State = adStateOpen Then Rs.Close
Rs.Open "select * from T_DATE", Con, adOpenStatic, adLockPessimistic
Set mshflexgrid1.DataSource = Rs
With Me.mshflexgrid1
vMin = Val(.TextMatrix(1, 3))
vMax = Val(.TextMatrix(1, 3))
'====================================
'====================================
For XCol = 0 To .Cols - 1
For I = 1 To .Rows - 1
.Row = I
.Col = .Cols - 1
If Rs2.State = adStateOpen Then Rs2.Close
Rs2.Open "select * from T_DATE Where d_value =" & Val(.TextMatrix(I, 3)), Con, adOpenStatic, adLockPessimistic
If Rs2.RecordCount > 1 Then
' If Trim(.Text) = "repeater" Then
.Row = I
.Col = XCol
.CellBackColor = &HC0C0FF
Else 'If Trim(.Text) = "non repeater" Then
.Row = I
.Col = XCol
.CellBackColor = &HC0FFC0
End If
vMe = Val(.TextMatrix(I, 3))
If vMe < vMin Then
vMin = vMe
End If
If vMe > vMax Then
vMax = vMe
End If
Next I
Next XCol
For XCol = 0 To .Cols - 1
For I = 1 To .Rows - 1
.Row = I
.Col = XCol
If Val(.TextMatrix(I, 3)) = vMin Then
.CellBackColor = &HFFFFC0
End If
If Val(.TextMatrix(I, 3)) = vMax Then
.CellBackColor = &HFFFF00
End If
Next I
Next XCol
End With
End Sub