新建一个表,有日期列和索引列,记录当天的索引,只有一行数据
Dim t As Table = Tables("天天向上")
Dim dr As DataRow = DataTables("新表").datarows(0)
If dr.isnull("日期") Then
t.Position = 0
dr("日期") = Date.today
dr("索引") = 0
Else
Dim idx As Integer = dr("索引")
If dr("日期") < Date.today Then
If idx = t.Rows.Count - 1 Then
idx = 0
Else
idx += 1
End If
dr("日期") = Date.today
dr("索引") = idx
End If
t.Position = idx
End If