📄 addexcel(4).frm
字号:
Else
If xlSheet.Cells(Row - 1, Col + 1).Value = "" Then
xlSheet.Cells(Row - 1, Col + 1).Value = Shi
Else
If xlSheet.Cells(Row - 1, Col + 2).Value = "" Then
xlSheet.Cells(Row - 1, Col + 2).Value = Shi
Else
xlSheet.Cells(Row - 1, Col + 3).Value = Shi
End If
End If
End If
Else
If KSJ < 8 Then
If xlSheet.Cells(Row - 1, Col).Value = "" Then
xlSheet.Cells(Row - 1, Col).Value = Shi
Else
If xlSheet.Cells(Row - 1, Col + 1).Value = "" Then
xlSheet.Cells(Row - 1, Col + 1).Value = Shi
Else
If xlSheet.Cells(Row - 1, Col + 2).Value = "" Then
xlSheet.Cells(Row - 1, Col + 2).Value = Shi
Else
xlSheet.Cells(Row - 1, Col + 3).Value = Shi
End If
End If
End If
End If
End If
Else
If xlSheet.Cells(Row, Col).Value = "" Then
xlSheet.Cells(Row, Col).Value = Shi
Else
If xlSheet.Cells(Row, Col + 1).Value = "" Then
xlSheet.Cells(Row, Col + 1).Value = Shi
Else
If xlSheet.Cells(Row, Col + 2).Value = "" Then
xlSheet.Cells(Row, Col + 2).Value = Shi
Else
xlSheet.Cells(Row, Col + 3).Value = Shi
End If
End If
End If
'Col = Col - 2
'Row = Row - 1
End If
'If ShiKuaRi = False Then
' If xlSheet.Cells(Row, Col).Value = "" Then
' xlSheet.Cells(Row, Col).Value = Shi 'CStr(Mid(Rst("sbshijian"), 1, 5)) 'Str(Rst("sbshijian").Value)
' Else
' If xlSheet.Cells(Row, Col + 1).Value = "" Then
' Col = Col + 1
' xlSheet.Cells(Row, Col).Value = Shi
' Row = Row - 1
'Col = Col - 1
' End If
' End If
'Else
' Col = Col - 2
' Row = Row - 1
'End If
'Rst.MoveNext
If xlSheet.Cells(Row, Col) = "" Then
xlSheet.Cells(Row, Col) = Shi1
Else
If xlSheet.Cells(Row, Col + 1) = "" Then
xlSheet.Cells(Row, Col + 1) = Shi1
Else
If xlSheet.Cells(Row, Col + 2) = "" Then
xlSheet.Cells(Row, Col + 2) = Shi1
Else
If xlSheet.Cells(Row, Col + 3) = "" Then
xlSheet.Cells(Row, Col + 3) = Shi1
Else
xlSheet.Cells(Row, Col + 4) = Shi1
End If
End If
End If
End If
'Col = Col + 1
'Rst.MoveNext
If xlSheet.Cells(Row, Col + 1) = "" Then
xlSheet.Cells(Row, Col + 1) = Shi3
Else
If xlSheet.Cells(Row, Col + 2) = "" Then
xlSheet.Cells(Row, Col + 2) = Shi3
Else
xlSheet.Cells(Row, Col + 3).Value = Shi3
End If
End If
'Col = Col + 1
If ShiKuaRi = False Then
'Col = Col - 3
Else
'Col = Col - 2
End If
End If
If Rst.RecordCount = 1 Then
AllNothing = True
Row = Row + 1
Shi = Format(Rst("shijian"), "hh:mm")
If (Shi > "23:00" And Shi < "23:59") Or Shi = "00:00" Then
If xlSheet.Cells(Row + 1, Col).Value = "" Then
xlSheet.Cells(Row + 1, Col).Value = Shi
End If
Else
'Row = Row + 1
'If Shi > "07:00" And Shi < "08:00" Then
' xlSheet.Cells(Row + 1, Col + 1).Value = Shi
'Else
' xlSheet.Cells(Row + 2, Col).Value = Shi
'End If
If (Shi > "00:00" And Shi < "00:59 ") Or Shi = "00:00" Then
If xlSheet.Cells(Row - 1, Col).Value = "" Then
xlSheet.Cells(Row - 1, Col).Value = Shi
Else
If xlSheet.Cells(Row - 1, Col + 1).Value = "" Then
xlSheet.Cells(Row - 1, Col + 1).Value = Shi
Else
If xlSheet.Cells(Row - 1, Col + 2).Value = "" Then
xlSheet.Cells(Row - 1, Col + 2).Value = Shi
Else
xlSheet.Cells(Row - 1, Col + 3).Value = Shi
End If
End If
End If
Else
If xlSheet.Cells(Row, Col).Value = "" Then
xlSheet.Cells(Row, Col).Value = Shi
Else
If xlSheet.Cells(Row, Col + 1).Value = "" Then
xlSheet.Cells(Row, Col + 1).Value = Shi
End If
End If
End If
'Row = Row + 1
End If
Set Rst = New ADODB.Recordset
Rst.Open "select * from dangtiandaka where xingming='" + Ming + "' and riqi='" + Ri + "'", Cnn, adOpenStatic, adLockBatchOptimistic, adCmdText
If Not Rst.EOF Then
' If Shi = Format(Rst!sbshijian, "hh:mm") Then
' AllNothing = False
' Row = Row + 1
' xlSheet.Cells(Row, Col).Value = Shi
' Col = Col + 1
' Col = Col - 1
' Row = Row - 1
' End If
' If Shi = Format(Rst!xbshijian, "hh:mm") Then
' AllNothing = False
' Row = Row + 1
' Col = Col + 1
' xlSheet.Cells(Row, Col) = Shi
' Row = Row - 1
' Col = Col - 1
' End If
' If Shi = Format(Rst!sbshijian1, "hh:mm") Then
' AllNothing = False
' Row = Row + 1
' xlSheet.Cells(Row, Col).Value = Shi
' Col = Col + 1
' Col = Col - 1
' Row = Row - 1
' End If
' If Shi = Format(Rst!xbshijian1, "hh:mm") Then
' AllNothing = False
' Row = Row + 1
' Col = Col + 1
' xlSheet.Cells(Row, Col) = Shi
' Row = Row - 1
' Col = Col - 1
' End If
' If AllNothing = True Then
' Row = Row + 1
' xlSheet.Cells(Row, Col).Value = Shi
' Col = Col + 1
' Col = Col - 1
' Row = Row - 1
' End If
Else
Row = Row + 1
xlSheet.Cells(Row, Col) = Shi
Col = Col + 1
Col = Col - 1
Row = Row - 1
End If
'Row = Row + 1
End If
'Row = Row + 1
'Col = Col + 1
'Row = Row - 1
'Col = Col - 1
End If
Else
Row = Row + 1
'Col = Col + 2
End If
Loop
OneFinish = True
X = X + 1
'End If
'Loop
Loop
End Sub
Private Sub YiYe()
'Do Until Row = 17
'YiHang
'Row = Row + 3
'Loop
End Sub
Private Sub Command3_Click()
Dim Nian, T, EndTime
Dim i As Index
OneFinish = False
GroupFinish = False
ShiKuaRi = False
Nian = Year(Date)
X = 0
T = 1
AA = SelMonth.Text
D1 = "01"
D2 = "31"
BB = Nian & AA & D1
CC = Nian & AA & D2
Do Until X = NameNum
If OneFinish = False Then
Row = 3 '7纵
Col = 2 + 3 * X 'B横
Else
Row = Row - 31
Col = Col + 4
End If
If X = 4 * T Then
Row = Row + 33
Col = Col - 16
GroupFinish = True
T = T + 1
'Do Until X = 7
End If
'If xlSheet.Cells(7, 2).Value <> "" Then
' Col = Col + 3
'Else
Ming = xlSheet.Cells(Row, Col).Value
'Ming = "冯健韵"
Do Until xlSheet.Cells(Row, 1).Value = 31
ShiKuaRi = False
Ri = Nian & AA & xlSheet.Cells(Row + 1, 1).Value
Set Rst = New ADODB.Recordset
Rst.Open "select * from kaoqishuju where xingming='" + Ming + "'and riqi='" + Ri + "' order by riqi,shijian", Cnn, adOpenKeyset, adLockOptimistic, adCmdText
Do While Not Rst.EOF
Loop
Loop
OneFinish = True
X = X + 1
'End If
'Loop
Loop
End Sub
Private Sub Form_Load() 'Col横,Row 纵
Cnn.Open "kaoqinclub", "andy", "1234"
Set Rst = New ADODB.Recordset
Rst.Open "select * from selmonth order by selmonth", Cnn, adOpenKeyset, adLockOptimistic, adCmdText
Do While Not Rst.EOF
SelMonth.AddItem Rst.Fields(0)
Rst.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -