The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
Private Sub Command1_Click()
Dim kk As Long
For kk = 1 To MSHFlexGrid1.Rows - 1
If MSHFlexGrid1.TextMatrix(kk, 1) = MSHFlexGrid1.TextMatrix(kk, 0) Then
' MSHFlexGrid1.TextMatrix(kk, 1) = Format(CDate(Format(MSHFlexGrid1.TextMatrix(kk, 0), "0000-00-00 00:00")) + DateAdd("n", 1, Time()))
End If
Next kk
End Sub
Dim kk As Long
For kk = 1 To MSHFlexGrid1.Rows - 1
If MSHFlexGrid1.TextMatrix(kk, 0) <> "" Then
MSHFlexGrid1.TextMatrix(kk, 0) = Mid(MSHFlexGrid1.TextMatrix(kk, 0), 7, 4) & Left(MSHFlexGrid1.TextMatrix(kk, 0), 2) & Mid(MSHFlexGrid1.TextMatrix(kk, 0), 4, 2) & Mid(MSHFlexGrid1.TextMatrix(kk, 0), 12, 2) & Mid(MSHFlexGrid1.TextMatrix(kk, 0), 15, 2)
End If
If MSHFlexGrid1.TextMatrix(kk, 1) <> "" Then
MSHFlexGrid1.TextMatrix(kk, 1) = Mid(MSHFlexGrid1.TextMatrix(kk, 1), 7, 4) & Left(MSHFlexGrid1.TextMatrix(kk, 1), 2) & Mid(MSHFlexGrid1.TextMatrix(kk, 1), 4, 2) & Mid(MSHFlexGrid1.TextMatrix(kk, 1), 12, 2) & Mid(MSHFlexGrid1.TextMatrix(kk, 1), 15, 2)
End If
On Error Resume Next
If MSHFlexGrid1.TextMatrix(kk, 1) = MSHFlexGrid1.TextMatrix(kk, 0) Then
MSHFlexGrid1.TextMatrix(kk, 1) = Format(CDate(Format(MSHFlexGrid1.TextMatrix(kk, 0), "0000-00-00 00:00")) + 0.001, "yyyymmddhhnn")
End If
If MSHFlexGrid1.TextMatrix(kk, 0) <> "" Then
MSHFlexGrid1.TextMatrix(kk, 0) = Mid(MSHFlexGrid1.TextMatrix(kk, 0), 5, 2) & "/" & Mid(MSHFlexGrid1.TextMatrix(kk, 0), 7, 2) & "/" & Left(MSHFlexGrid1.TextMatrix(kk, 0), 4) & " " & Mid(MSHFlexGrid1.TextMatrix(kk, 0), 9, 2) & ":" & Mid(MSHFlexGrid1.TextMatrix(kk, 0), 11, 2) & ":" & "00"
MSHFlexGrid1.TextMatrix(kk, 1) = Mid(MSHFlexGrid1.TextMatrix(kk, 1), 5, 2) & "/" & Mid(MSHFlexGrid1.TextMatrix(kk, 1), 7, 2) & "/" & Left(MSHFlexGrid1.TextMatrix(kk, 1), 4) & " " & Mid(MSHFlexGrid1.TextMatrix(kk, 1), 9, 2) & ":" & Mid(MSHFlexGrid1.TextMatrix(kk, 1), 11, 2) & ":" & "00"
End If
Next kk
Private Sub Command1_Click()
Dim kk As Long
For kk = 1 To MSHFlexGrid1.Rows - 1
If MSHFlexGrid1.TextMatrix(kk, 0) <> "" Then
If MSHFlexGrid1.TextMatrix(kk, 1) = MSHFlexGrid1.TextMatrix(kk, 0) Then
MSHFlexGrid1.TextMatrix(kk, 1) = Format(DateAdd("n", 1, MSHFlexGrid1.TextMatrix(kk, 0)), "mm/dd/yyyy hh:mm:ss")
End If
End If
Next kk
'Auto column fit
Dim cell_wid As Single
Dim col_wid As Single
For c = 0 To MSHFlexGrid1.Cols - 1
col_wid = 0
For r = 0 To MSHFlexGrid1.Rows - 1
cell_wid = TextWidth(MSHFlexGrid1.TextMatrix(r, c))
If col_wid < cell_wid Then col_wid = cell_wid
Next r
MSHFlexGrid1.ColWidth(c) = col_wid + 120
Next c
'---------- Align MSHFlexgrid ----------------
With MSHFlexGrid1
Dim k As Long
For k = 0 To .Cols - 1
.ColAlignment(k) = flexAlignLeftCenter
Next
End With
End Sub
Dim kk As Long
Dim txt As String
For kk = 1 To MSHFlexGrid1.Rows - 1
If MSHFlexGrid1.TextMatrix(kk, 0) <> "" Then
If MSHFlexGrid1.TextMatrix(kk, 1) = MSHFlexGrid1.TextMatrix(kk, 0) Then
MSHFlexGrid1.TextMatrix(kk, 1) = Format(DateAdd("n", 1, MSHFlexGrid1.TextMatrix(kk, 0)), "mm/dd/yyyy hh:mm:ss")
txt = MSHFlexGrid1.TextMatrix(kk, 1)
If InStr(txt, "-") Then
txt = Replace(txt, "-", "/")
MSHFlexGrid1.TextMatrix(kk, 1) = txt
MSHFlexGrid1.Row = kk
MSHFlexGrid1.Col = 1
MSHFlexGrid1.CellBackColor = &H80FF&
End If
End If
End If
Next kk
For kk = 1 To MSHFlexGrid1.Rows - 1
If MSHFlexGrid1.TextMatrix(kk, 0) <> "" Then
If MSHFlexGrid1.TextMatrix(kk, 1) = MSHFlexGrid1.TextMatrix(kk, 0) Then
MSHFlexGrid1.TextMatrix(kk, 1) = Format(DateAdd("n", 1, MSHFlexGrid1.TextMatrix(kk, 0)), "mm/dd/yyyy hh:mm:ss")
End If
End If
Next kk
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
MSHFlexGrid1.TextMatrix(kk
End If