以下是引用northwolves在2007-10-14 21:07:42的发言: 哪个表需要导出?你把出错语句帖上来 一、当点击“数据导出”按钮时,日报表的数据将导入到月报表中,同时日报表中的数据会被清空;附件中的“数据导出”按钮在点击时没有一点前述作用。 Private Sub CommandButton1_Click() Dim i%, arr With Sheet2 If Not Sheet3.[a:a].Find(.Cells(1, 7)) Is Nothing Then 'If MsgBox("您确定要重复导出吗?", 32 + vbYesNo, "重要提示") = vbNo Then Exit Sub If MsgBox("您确定要重复导出吗?", 32 + vbokNo, "重要提示") = vbOK Then GoTo 1 1: ReDim arr(1 To 2, 1 To 23) For i = 1 To 23 arr(1, i) = .Cells(i + 2, 2) arr(2, i) = .Cells(i + 2, 4) Next i n = Sheet3.[c65].End(xlUp).Row + 1 Sheet3.Cells(n, 1) = .Cells(1, 7) Sheet3.Cells(n, 3).Resize(2, 23) = arr .[g1:h1].ClearContents .[b3:b36].ClearContents .[d38].ClearContents End If End With End Sub 二、下面的代码希望实现利用日期控件输入时间,但出现报错情况(运行时错误‘35788’): Private Sub Worksheet_SelectionChange(ByVal Target As Range) 'If Target.Count = 1 Then 'If Target.Column = 7 Then If Target.Address = "$G$1" Then With Me.DTPicker1 If Target <> "" Then .Value = Target End If .Visible = True .Top = Target.Top .Left = Target.Left Application.EnableEvents = False ActiveCell.Value = Me.DTPicker1.Value Me.DTPicker1.Visible = False Application.EnableEvents = True End With 'Else 'Me.DTPicker1.Visible = False 'End If End If End Sub
|