here is my code. Dim p As Integer = 0 Do While p <= DataGridView1.RowCount - 1 For q As Integer = 3 To 2 Step -1 If DataGridView1.Rows(p).Cells(1).Value <> "rep" Then If DataGridView1.Rows(p).Cells(q).Value IsNot Nothing Then 'DataGridView1.Rows(p).Cells(q).GetType.Name Dim column_type = (DataGridView1.Rows(p).Cells(q)).ValueType Dim column_type2 = (DataGridView1.Rows(p).Cells(q + 2)).ValueType If column_type Is GetType(String) Then MsgBox("ok") Else MsgBox(column_type.ToString & "mmmm") MsgBox(column_type2.ToString & "nnn") MsgBox(DataGridView1.Rows(p).Cells(q).Value) MsgBox(DataGridView1.Rows(p).Cells(q + 2).Value & "hhh") End If DataGridView1.Rows(p).Cells(q + 2).Value = DataGridView1.Rows(p).Cells(q).Value DataGridView1.Rows(p).Cells(q).Value = "" End If End If Next p = p + 1 Loop
DataGridView1.Rows(p).Cells(q+2)) = DataGridView1.Rows(p).Cells(q))
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)